Skip to main content
These examples use a Compose Key against the hosted API.
Use /v1/* when you want Compose receipts or x402 behavior. Use /external/v1/* when you are configuring an OpenAI-compatible IDE, SDK, or app.

List models

The response is a generated catalog. Use data[].modelId as the model string on native routes.

Make a chat call

Native routes are OpenAI-shaped, with Compose payment metadata added where it belongs.
The response is an OpenAI-compatible chat completion. Native responses may include receipt in the JSON body, and receipt data is also exposed through X-Receipt when available.

Stream a chat call

Streaming uses Server-Sent Events. Native chat streams emit OpenAI chat completion chunks, usage chunks, optional Compose receipt events, and then [DONE].

Use an external OpenAI-compatible client

Use /external/v1 when the client expects an OpenAI base URL.
External responses keep the body clean for OpenAI-compatible clients. Provider diagnostics are still available in headers: