Skip to main content
POST
/
v1
/
chat
/
completions
curl https://apolloai.lol/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $APOLLO_API_KEY" \
  -d '{
    "model": "gpt-oss-120b",
    "messages": [
      {
        "role": "system",
        "content": "You are a helpful assistant."
      },
      {
        "role": "user",
        "content": "Hello!"
      }
    ]
  }'
{
  "id": "chatcmpl-123",
  "object": "chat.completion",
  "created": 1677652288,
  "model": "gpt-oss-120b",
  "choices": [{
    "index": 0,
    "message": {
      "role": "assistant",
      "content": "Hello there, how may I assist you today?"
    },
    "finish_reason": "stop"
  }],
  "usage": {
    "prompt_tokens": 9,
    "completion_tokens": 12,
    "total_tokens": 21
  }
}
Generate natural language or code completions based on a list of messages. This endpoint is compatible with the OpenAI Chat Completions API.

Headers

x-api-key
string
required
Your Apollo AI API key. Alternatively, use Authorization: Bearer <token>.

Body Parameters

messages
array
required
A list of messages comprising the conversation so far.
model
string
required
The ID of the model to use (e.g., gpt-oss-120b, llama3). See Models for a full list.
stream
boolean
If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only server-sent events as they become available.
max_tokens
integer
The maximum number of tokens to generate in the chat completion.
temperature
number
What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
tools
array
A list of tools the model may call. Currently, only functions are supported as a tool.

Response

id
string
A unique identifier for the chat completion.
choices
array
A list of chat completion choices.
created
integer
The Unix timestamp (in seconds) of when the chat completion was created.
model
string
The model used for the chat completion.
usage
object
Usage statistics for the completion request.
curl https://apolloai.lol/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $APOLLO_API_KEY" \
  -d '{
    "model": "gpt-oss-120b",
    "messages": [
      {
        "role": "system",
        "content": "You are a helpful assistant."
      },
      {
        "role": "user",
        "content": "Hello!"
      }
    ]
  }'
{
  "id": "chatcmpl-123",
  "object": "chat.completion",
  "created": 1677652288,
  "model": "gpt-oss-120b",
  "choices": [{
    "index": 0,
    "message": {
      "role": "assistant",
      "content": "Hello there, how may I assist you today?"
    },
    "finish_reason": "stop"
  }],
  "usage": {
    "prompt_tokens": 9,
    "completion_tokens": 12,
    "total_tokens": 21
  }
}