Skip to main content

REST API

Completion is a long-running operation. Client needs to request it and then poll for the result. Please note that result is retained for only around 20 min.

Authentication

Supply API key in X-Api-Key header.

curl -X POST https://api.example.com/v2/completions \
-H "Content-Type: application/json" \
-H "X-Api-Key: YOUR_API_KEY" \
-d '{"input": {...}}'

Requesting Completion

Request

POST /v2/completions
{
"input": {
"messages": [...],
"audio_files": { ... },
"character": "...",
"character_params": { ... }
}
}

Response

{
"id": "/v2/completions/",
"state": "in-progress"
}

Checking Status

Request

GET /v2/completions/

Response

{
"id": "/v2/completions/",
"state": "",
"output": ...
}

Possible States

  • in-progress - Operation is in progress, check again later
  • completed - Response is generated successfully, output property contains the result
  • failed - Operation failed