> ## Documentation Index
> Fetch the complete documentation index at: https://docs.compose.market/llms.txt
> Use this file to discover all available pages before exploring further.

# Inference

> Model calls with catalog routing, metering, and payment on the same HTTP request.

Compose.Market inference is a hosted API for paid model calls. It resolves a model from the generated catalog, calls the right provider adapter, meters the result, and settles the payment attached to the request.

There are two public surfaces:

| Surface                              | Base path      | Who it is for                                                                                      |
| ------------------------------------ | -------------- | -------------------------------------------------------------------------------------------------- |
| Native Compose inference             | `/v1`          | Clients that want x402 negotiation, Compose receipts, response retrieval, and full model metadata. |
| External OpenAI-compatible inference | `/external/v1` | IDEs and apps that already speak the OpenAI API shape and only support bearer auth.                |

Both surfaces use the same catalog and adapters. The difference is the contract around the call: native routes can expose Compose receipts and x402 details, while external routes keep response bodies compatible with OpenAI-style clients.

## How models route

Every call starts with a public model ID from the generated catalog. The catalog row carries the provider, pricing, limits, modalities, capabilities, and optional `upstreamModelId` for duplicate provider rows.

Duplicate upstream IDs are explicit. The priority winner keeps the bare ID; the other provider rows get readable public aliases:

| Public model ID  | Provider selected | Provider wire model |
| ---------------- | ----------------- | ------------------- |
| `gpt-5.5`        | `azure`           | `gpt-5.5`           |
| `openai/gpt-5.5` | `openai`          | `gpt-5.5`           |

The model string is the contract. Compose does not inspect the prompt to guess a provider, and it does not silently fall back to a duplicate provider row.

## Native endpoints

| Method | Path                       | Description                                                                        |
| ------ | -------------------------- | ---------------------------------------------------------------------------------- |
| `GET`  | `/v1/models`               | Generated catalog used by the API.                                                 |
| `GET`  | `/v1/models/all`           | Extended generated catalog, when present.                                          |
| `POST` | `/v1/models/search`        | Search and filter by provider, modality, operation, streaming, context, and price. |
| `GET`  | `/v1/modalities`           | Modality catalogs derived from model metadata.                                     |
| `POST` | `/v1/chat/completions`     | OpenAI-shaped chat completions.                                                    |
| `POST` | `/v1/responses`            | OpenAI-shaped Responses-style input and output.                                    |
| `POST` | `/v1/embeddings`           | Embeddings.                                                                        |
| `POST` | `/v1/images/generations`   | Image generation.                                                                  |
| `POST` | `/v1/images/edits`         | Image editing.                                                                     |
| `POST` | `/v1/audio/speech`         | Text to speech.                                                                    |
| `POST` | `/v1/audio/transcriptions` | Speech to text.                                                                    |
| `POST` | `/v1/videos/generations`   | Video generation submission.                                                       |
| `GET`  | `/v1/videos/{id}`          | Video job status.                                                                  |
| `GET`  | `/v1/videos/{id}/stream`   | Video job status over SSE.                                                         |

Native routes accept Compose Keys and raw x402 payment flows. Use them when your integration wants receipts, retrieval routes, or payment negotiation as part of the API contract.

## External endpoints

| Method | Path                                | Description                                    |
| ------ | ----------------------------------- | ---------------------------------------------- |
| `GET`  | `/external/v1/models`               | OpenAI-shaped model list for external clients. |
| `POST` | `/external/v1/chat/completions`     | Chat completions with Compose Key auth.        |
| `POST` | `/external/v1/responses`            | Responses-style calls with Compose Key auth.   |
| `POST` | `/external/v1/embeddings`           | Embeddings with Compose Key auth.              |
| `POST` | `/external/v1/images/generations`   | Image generation with Compose Key auth.        |
| `POST` | `/external/v1/audio/speech`         | Speech generation with Compose Key auth.       |
| `POST` | `/external/v1/audio/transcriptions` | Transcription with Compose Key auth.           |
| `POST` | `/external/v1/videos/generations`   | Video generation with Compose Key auth.        |
| `GET`  | `/.well-known/opencode`             | Remote OpenCode config.                        |

External routes use Compose Key bearer auth. They return OpenAI-shaped JSON and SSE, and keep Compose receipts out of the response body.

## How a request runs

```mermaid theme={null}
flowchart LR
  Client[Client] --> API[Compose API]
  API --> Catalog[Catalog resolver]
  Catalog --> Pay[Payment preparation]
  Pay --> Adapter[Provider adapter]
  Adapter --> Provider[Upstream provider]
  Provider --> Meter[Metering]
  Meter --> Settle[Settlement]
  Settle --> Client
```

That flow is intentionally plain: resolve the catalog row, authorize the spend, call the adapter, meter the result, settle the payment.

## Related

* [Quickstart](/inference/quickstart)
* [External clients](/inference/external-use/overview)
* [Streaming](/inference/streaming)
* [Tools](/inference/tools)
* [Metering](/inference/metering)
* [x402](/x402/introduction)
