# Developer API reference

URL: https://docs.assistantcore.com/en/developers/reference

Base URL, authentication, operations, response objects, and machine-readable contracts for Developer API v1.

The OpenAPI and AsyncAPI files are the source of truth for every request, response, and event. Use them for code generation; this page summarises them.

## Specification files [#specification-files]

<Cards>
<Card title="OpenAPI 3.1" description="REST operations, SSE, errors, and schemas (openapi.yaml)." href="/api/openapi.yaml" />

<Card title="AsyncAPI 3.1" description="Voice WebSocket client and server events (asyncapi.yaml)." href="/api/asyncapi.yaml" />
</Cards>

## Base URL and authentication [#base-url-and-authentication]

| Item | Value |
| :--- | :--- |
| REST base URL | `https://api.assistantcore.com` |
| Voice WebSocket | `wss://api.assistantcore.com/v1/voice` (use the `websocket_url` a session returns) |
| Authentication | `Authorization: Bearer <your-api-key>` on every REST call |
| Request body | JSON (`application/json`), except file upload (`multipart/form-data`) |
| Status | Preview, no separate sandbox |

The key decides the assistant and the allowed scopes. Read endpoints take `external_user_id` as a query parameter; write endpoints take it in the body.

## Operations [#operations]

| Method | Path | Scope | Success |
| :--- | :--- | :--- | :---: |
| `POST` | `/v1/responses` | `chat:write` | `200` |
| `GET` | `/v1/responses/{response_id}` | `chat:write` | `200` |
| `POST` | `/v1/responses/{response_id}/cancel` | `chat:write` | `200` |
| `POST` | `/v1/files` | `files:write` | `201` |
| `GET` | `/v1/conversations/{conversation_id}` | `conversations:read` | `200` |
| `GET` | `/v1/conversations/{conversation_id}/messages` | `conversations:read` | `200` |
| `PUT` | `/v1/messages/{message_id}/feedback` | `feedback:write` | `204` |
| `DELETE` | `/v1/messages/{message_id}/feedback` | `feedback:write` | `204` |
| `POST` | `/v1/voice/sessions` | `voice:connect` | `201` |
| `DELETE` | `/v1/users/{external_user_id}` | `users:delete` | `204` |

Examples for each operation are in [Chat API](/en/developers/chat-api) and [Voice API](/en/developers/voice-api).

## Common headers [#common-headers]

| Header | Direction | Meaning |
| :--- | :--- | :--- |
| `Idempotency-Key` | Request | Optional on `POST /v1/responses`, 1–255 characters. |
| `X-Request-ID` | Both | Sent on every response. If you send one (1–64 characters of `A-Z a-z 0-9 . _ -`), it is echoed back. |
| `RateLimit-Policy`, `RateLimit` | Response | Rate-limit state; see [Errors and limits](/en/developers/errors-limits). |
| `Retry-After` | Response | Seconds to wait after `429 RATE_LIMITED`. |
| `Idempotent-Replayed` | Response | `true` when a completed idempotent request is replayed. |

## Objects [#objects]

### Response [#response]

Returned by `POST /v1/responses` (non-streaming), `GET /v1/responses/{response_id}`, and `POST /v1/responses/{response_id}/cancel`. `GET /v1/responses/{response_id}` also takes `stream` (boolean, default `false`) and `starting_after` (integer ≥ 0, default `0`) to follow a background response's SSE events; see [Background responses](/en/developers/chat-api#background-responses).

<TypeTable />

### File [#file]

<TypeTable type={{"id":{"type":"string (UUID)","description":"Pass it in `file_ids`.","required":true},"object":{"type":"\"file\"","required":true},"filename":{"type":"string","required":true},"bytes":{"type":"integer","description":"Stored size.","required":true},"mime_type":{"type":"string","required":true}}} />

### Conversation and message [#conversation-and-message]

<TypeTable type={{"conversation.id":{"type":"string (UUID)","required":true},"conversation.object":{"type":"\"conversation\"","required":true},"conversation.created_at":{"type":"string (date-time)","required":true},"message.id":{"type":"string (UUID)","required":true},"message.object":{"type":"\"message\"","required":true},"message.role":{"type":"\"user\" | \"assistant\" | \"system\"","required":true},"message.content":{"type":"string","description":"Text parts joined; attachments are not included.","required":true},"message.sources":{"type":"Source[]","description":"For an assistant message, what its `[n]` citations point to; empty otherwise.","required":true},"message.created_at":{"type":"string (date-time)","required":true}}} />

A message page is `{ "object": "list", "data": [...], "has_more", "first_id", "last_id" }`.

### Voice session [#voice-session]

<TypeTable type={{"id":{"type":"string","description":"`sess_` followed by 32 hex characters.","required":true},"model":{"type":"string","description":"Chat model (standard mode) or realtime model code.","required":true},"token":{"type":"string","description":"Single use; expires after 120 seconds.","required":true},"expires_at":{"type":"string (date-time)","required":true},"websocket_url":{"type":"string","required":true}}} />

### Error [#error]

Every `/v1` error, and the SSE `error` event, uses this shape. Codes are listed in [Errors and limits](/en/developers/errors-limits).

<TypeTable type={{"code":{"type":"string","description":"Stable code from the error registry.","required":true},"message":{"type":"string","description":"Human-readable; do not parse it.","required":true},"details":{"type":"object | null","description":"Extra fields, for example `errors`, `bucket`, `file_id`, `max_bytes`."},"request_id":{"type":"string","required":true},"retryable":{"type":"boolean","description":"Whether retrying the same request can succeed.","required":true}}} />

## Compatibility during Preview [#compatibility-during-preview]

- New optional fields, events, and operations can be added to `/v1` without a new path. Ignore fields and event types you do not know.
- Breaking changes are listed in the [changelog](/en/developers/changelog), before rollout whenever possible.
- Do not depend on fields or events that are not in the contracts.
- The GA contract and the deprecation and sunset policy will be published before Preview ends.

<Callout type="warn">
Preview is not a GA compatibility commitment. Pin code generation to a contract revision you have tested, and read the changelog before you update.
</Callout>