> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.singularityapi.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.singularityapi.dev/_mcp/server.

# Models & Receipts

## `GET /v1/models`

Requires an API key. Returns every model in the catalog with its per-endpoint capabilities: context window, max and default output tokens, and current pricing as 12-decimal-place per-million-token strings.

**`cURL`**

```bash title="cURL"
curl https://api.singularityapi.dev/v1/models \
  -H "Authorization: Bearer $SINGULARITY_API_KEY"
```

**`Python`**

```python title="Python"
import httpx

api_key = "YOUR_API_KEY"
models = httpx.get(
    "https://api.singularityapi.dev/v1/models",
    headers={"Authorization": f"Bearer {api_key}"},
).json()
```

**`JavaScript`**

```javascript title="JavaScript"
const apiKey = "YOUR_API_KEY";
const models = await fetch("https://api.singularityapi.dev/v1/models", {
  headers: { Authorization: `Bearer ${apiKey}` },
}).then((r) => r.json());
```

A model entry looks like this:

```json
{"object": "list", "data": [{"id": "deepseek-v4-flash", "object": "model", "created": 1690000000,
  "owned_by": "singularityapi", "capabilities": [{"endpoint": "/v1/chat/completions",
  "context_window_tokens": 1000000, "maximum_output_tokens": 384000, "default_output_tokens": 8192,
  "pricing": {"input_per_million_usd": "0.081000000000", "output_per_million_usd": "0.162000000000"}}]}]}
```

Each model's `capabilities` array has one entry per endpoint it serves — a model with both chat completions and responses capability has two entries, each with its own limits and pricing.

> **Note**
>
> This endpoint takes no query parameters — any query string returns a 400. Responses are sent with `cache-control: no-store`, so what you get back is always current: pricing, limits, and the model list itself.

## `GET /v1/receipts/{receipt_id}`

Requires an API key, and only resolves receipts belonging to your own account — an unknown or foreign receipt ID returns 404 `receipt_not_found` inside the standard [error envelope](/api/errors-rate-limits).

**`cURL`**

```bash title="cURL"
curl https://api.singularityapi.dev/v1/receipts/RECEIPT_ID \
  -H "Authorization: Bearer $SINGULARITY_API_KEY"
```

**`Python`**

```python title="Python"
import httpx

api_key = "YOUR_API_KEY"
receipt = httpx.get(
    "https://api.singularityapi.dev/v1/receipts/RECEIPT_ID",
    headers={"Authorization": f"Bearer {api_key}"},
).json()
```

**`JavaScript`**

```javascript title="JavaScript"
const apiKey = "YOUR_API_KEY";
const receipt = await fetch(
  "https://api.singularityapi.dev/v1/receipts/RECEIPT_ID",
  { headers: { Authorization: `Bearer ${apiKey}` } },
).then((r) => r.json());
```

A receipt looks like this:

```json
{
  "id": "rcpt_...", "object": "route_receipt", "request_id": "req_...",
  "requested_model": "deepseek-v4-flash", "served_model": "deepseek-v4-flash",
  "surface": "chat_completions", "requested_contract": null, "contract_passed": false,
  "state": "settled", "fallbacks_attempted": 0, "attempts_count": 1,
  "request_transformed": true, "transformed_fields": ["model", "max_tokens"],
  "usage": {"input_tokens": 123, "output_tokens": 45, "estimated": false},
  "latency_ms": 812, "total_cost_usd": "0.000123456789",
  "created_at": "2026-08-03T00:00:00.000000Z", "terminal_at": "2026-08-03T00:00:01.000000Z"
}
```

`state` progresses through the request's lifecycle to a terminal state. `usage` and `total_cost_usd` are `null` until the receipt reaches that terminal state — poll or wait before reading the final numbers.

> **Note**
>
> For a full field-by-field glossary of the receipt object, see [Receipts & Billing](/platform/receipts-billing).