Skip to main content
POST
/
v1
/
chat
/
completions
Chat Completions
curl --request POST \
  --url https://api.fortytwo.network/v1/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "max_completion_tokens": 123,
  "max_tokens": 123,
  "messages": [
    {
      "content": "<string>",
      "role": "user"
    }
  ],
  "model": "<string>",
  "stream": false,
  "response_format": {}
}'
{
  "id": "<string>",
  "choices": [
    {
      "finish_reason": "stop",
      "index": 123,
      "message": {
        "content": "<string>",
        "role": "user"
      }
    }
  ],
  "created": 123,
  "model": "fortytwo-preview",
  "object": "chat.completion",
  "usage": {
    "prompt_tokens": 123,
    "completion_tokens": 123,
    "total_tokens": 123
  }
}

Authorizations

Authorization
string
header
required

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

Body

application/json
messages
Message · object[]
required
model
string
required
max_completion_tokens
integer | null
max_tokens
integer | null
stream
boolean
default:false
response_format
object | null

Response

Successful Response

choices
Choice · object[]
required
usage
object
required
id
string
created
integer
model
default:fortytwo-preview
Available options:
fortytwo-preview
object
string
default:chat.completion
Allowed value: "chat.completion"