Skip to main content
POST
/
v1
/
chat
/
completions
curl --request POST \
  --url 'https://api.elkapi.com/v1/chat/completions' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "gemini-3.1-pro-preview",
  "stream": false,
  "messages": [
    {
      "role": "user",
      "content": "Hello, please introduce yourself"
    }
  ],
  "contents": [
    "Hello, please introduce yourself"
  ]
}'
{
  "id": "id",
  "model": "gemini-3.1-pro-preview",
  "object": "object",
  "created": 1,
  "choices": [
    {
      "index": 1,
      "message": {
        "role": "user",
        "content": "Hello, please introduce yourself"
      },
      "finish_reason": "finish_reason"
    }
  ],
  "usage": {
    "prompt_tokens": 1,
    "completion_tokens": 1,
    "total_tokens": 1
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.elkapi.com/llms.txt

Use this file to discover all available pages before exploring further.

curl --request POST \
  --url 'https://api.elkapi.com/v1/chat/completions' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "gemini-3.1-pro-preview",
  "stream": false,
  "messages": [
    {
      "role": "user",
      "content": "Hello, please introduce yourself"
    }
  ],
  "contents": [
    "Hello, please introduce yourself"
  ]
}'
{
  "id": "id",
  "model": "gemini-3.1-pro-preview",
  "object": "object",
  "created": 1,
  "choices": [
    {
      "index": 1,
      "message": {
        "role": "user",
        "content": "Hello, please introduce yourself"
      },
      "finish_reason": "finish_reason"
    }
  ],
  "usage": {
    "prompt_tokens": 1,
    "completion_tokens": 1,
    "total_tokens": 1
  }
}

Authorizations

Authorization
string
required
All endpoints require Bearer Token authentication.Add it to the request headers:
Authorization: Bearer YOUR_API_KEY

Body

model
string
default:"gemini-3.1-pro-preview"
required
Example: gemini-3.1-pro-preview
stream
boolean
required
messages
array<object>
required
messages.role
string
messages.content
string
extra_body
object
extra_body.google
object
required
extra_body.google.image_config
object
required
extra_body.google.image_config.aspect_ratio
string
required
extra_body.google.image_config.image_size
string
required
contents
array<object>
required
contents.role
string
contents.parts
array<object>
contents.parts.text
string

Response

id
string
model
string
default:"gemini-3.1-pro-preview"
Example: gemini-3.1-pro-preview
object
string
created
integer
choices
array<object>
choices.index
integer
choices.message
object
choices.message.role
string
required
choices.message.content
string
required
choices.finish_reason
string
usage
object
usage.prompt_tokens
integer
required
usage.completion_tokens
integer
required
usage.total_tokens
integer
required