Skip to main content
POST
/
v1
/
chat
/
completions
Create a chat completion
curl --request POST \
  --url https://api.astrolabe.run/v1/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "astrolabe/coding",
  "messages": [
    {
      "role": "user",
      "content": "Explain this error."
    }
  ],
  "metadata": {
    "astrolabe": {
      "stack": "code-agent",
      "quality": "high"
    }
  }
}
'
{
  "id": "<string>",
  "object": "<string>",
  "created": 123,
  "model": "<string>",
  "choices": [
    {}
  ],
  "usage": {},
  "astrolabe": {}
}
POST /v1/chat/completions is the compatibility endpoint for clients that still use OpenAI Chat Completions. It uses the same Cloud auth, stack resolution, routing, billing, fallback, verification, and trace runtime as /v1/responses.
{
  "model": "astrolabe/coding",
  "messages": [
    {
      "role": "user",
      "content": "Explain this build failure in one paragraph."
    }
  ],
  "metadata": {
    "astrolabe": {
      "stack": "code-agent",
      "quality": "high",
      "fallback": true
    }
  }
}

Prefer Responses for new clients

Use /v1/responses for new integrations when your client supports it. Keep Chat Completions for existing libraries and compatibility paths.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
messages
object[]
required
model
string
default:astrolabe/auto
stream
boolean
default:false
tools
object[]
tool_choice
any
response_format
any
metadata
object

Response

Successful JSON or streaming response.

id
string
object
string
created
integer
model
string
choices
object[]
usage
object
astrolabe
object