Skip to main content

Completions

Creates a completion for the provided prompt.

POST /v1/inference/completions

Classic completion endpoint (OpenAI-compatible).

Request Headers

Content-Type: "application/json"
Authorization: Bearer GRAVIXLAYER_API_KEY

Example Usage

completions.sh
curl -XPOST http://api.gravixlayer.com/v1/inference/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $GRAVIXLAYER_API_KEY" \
-d '{
"model": "llama3.1:8b-instruct-fp16",
"stream": false,
"prompt": "What comes after Monday?"
}'

Response:

{
"id": "cmpl-713",
"object": "text_completion",
"created": 1752094856,
"model": "llama3.1:8b-instruct-fp16",
"system_fingerprint": "fp_ollama",
"choices": [
{
"text": "The days of the week follow in this order:\n\n1. Sunday\n2. Monday\n3. Tuesday\n4. Wednesday\n5. Thursday\n6. Friday\n7. Saturday\n\nSo, if today is Monday, then tomorrow would be Tuesday!",
"index": 0,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 15,
"completion_tokens": 52,
"total_tokens": 67
}
}