Skip to main content
The inference API is OpenAI-compatible. Point an OpenAI SDK or any OpenAI-compatible client at TokenChange and use an inference key.

Base URL

Authentication

Send an inference key as a Bearer token:
API tokens (tcg_...) for the REST API don’t work here and return 401 invalid_api_key.

Use an OpenAI SDK

Differences from the OpenAI API

  • Streaming only. Completion requests must set "stream": true. Requests without it, or with "stream": false, fail with 400.
  • Models are catalog slugs. Pass a slug from the catalog, or pin an endpoint with <model-slug>/ep/<endpoint>.
  • Price options. An optional provider object filters and orders endpoints by price. See Price options.
  • Fields are passed through. Other request fields, such as tools, response_format or top_p, go to the endpoint unchanged. Whether they’re honored depends on the endpoint; check its capabilities.
  • Request size. Request bodies can be up to 32 MiB.

Errors

Errors use the OpenAI error format. See Errors.