Skip to main content
POST
https://ageneral.ai
/
v1
/
chat
/
completions
Create chat completion
curl --request POST \
  --url https://ageneral.ai/v1/chat/completions \
  --header 'Ageneral-Project-Id: <ageneral-project-id>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "messages": [
    {}
  ],
  "model": "openai/gpt-4o-mini",
  "stream": true,
  "temperature": 123,
  "max_tokens": 123,
  "tools": [
    {}
  ]
}
'
{}

Authorizations

Authorization
string
header
required

Session JWT from Ageneral sign-in. Send as Authorization: Bearer <token>.

Headers

Ageneral-Project-Id
string
required

Project id. You must be a member with access.

Ageneral-Session-Id
string

Existing platform chat session to continue. Omit to create a new session on first non-/new turn.

Body

application/json

Aligned with OpenAI Create chat completion. The server may override or fill model and merges prior turns from storage.

messages
object[]
required
model
string

Optional provider/model; a default applies when omitted.

Example:

"openai/gpt-4o-mini"

stream
boolean
temperature
number
max_tokens
integer
tools
object[]

Response

Success. JSON completion object or text/event-stream when streaming.

OpenAI-compatible chat completion object when not streaming.