Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.zerogpu.ai/llms.txt

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

POST /v1/chat/completions

Some models are invoked with a chat-completions style body (messages array) instead of the Responses input field. The dashboard and model catalog indicate which route applies.

Request headers

Same as Responses: x-api-key, x-project-id, content-type: application/json.

Request body

ParameterTypeRequiredDescription
modelstringYesModel identifier from your dashboard
messagesarrayYesList of objects with role (system, user, or assistant) and string content
metadataobjectNoModel-specific options (e.g. PII mask, usecase) when supported

Example

curl --location 'https://api.zerogpu.ai/v1/chat/completions' \
  --header 'content-type: application/json' \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'x-project-id: YOUR_PROJECT_ID' \
  --data '{
    "model": "YOUR_MODEL",
    "messages": [
      { "role": "user", "content": "Your input text here..." }
    ]
  }'
Install the official SDK from npm or PyPI (pip install zerogpu-api). Source: zerogpu/SDK. Response JSON shape depends on the model; handle errors the same way as API error codes.