API docs

Use the OpenAI-compatible base URL with Aiduct API keys.

OPENAI_BASE_URL=https://api.aiduct.ai/v1
OPENAI_API_KEY=ad_...
post/v1/chat/completions

Create a chat completion

OpenAI ChatCompletion-compatible endpoint. Set `stream: true` to receive a Server-Sent Events stream where each `data:` line is a `chat.completion.chunk` payload terminated by `data: [DONE]`. Model id is the API-platform id from `GET /v1...

post/v1/messages

Anthropic Messages (Claude-native protocol)

Native Anthropic Messages protocol. Use this when your client speaks the Anthropic SDK shape (e.g. Claude Code with `ANTHROPIC_BASE_URL=https://api.aiduct.ai`). Set `stream: true` for SSE; events follow Anthropic's `event: <type>\ndata: ...

post/v1/responses

OpenAI Responses API (Codex CLI protocol)

Native OpenAI Responses protocol (`responses.create` SDK method, used by the Codex CLI). Accepts only OpenAI-family platform model ids. Set `stream: true` for SSE event stream.

post/v1/images/generations

Generate or edit an image from a prompt

OpenAI Images-compatible endpoint. Some models, such as `gpt-image-2`, also accept `input_media` reference images. No streaming.

post/v1/videos/generations

Submit an async video-generation job

Always async. Returns a queue ticket; poll the `status_url` until the job completes, then read the final result from `response_url`. Use `cancel_url` to abort. Optional `webhook_url` lets us POST `response.completed` to a customer endpoi...

get/v1/queue/requests/{id}

Fetch the queued job's result (or terminal-state payload)

200 with the final result when status is `completed`. 200 with `{status:'failed'|'cancelled', error, ...}` when terminal but unsuccessful (no body retry, just inspect). 202 with the polling payload when still in progress.

get/v1/queue/requests/{id}/status

Cheap poll of a job's current state

Always returns 200 with the latest status. Safe to call at sub-second cadence — does not touch upstream providers.

post/v1/queue/requests/{id}/cancel

Cancel a queued job

Marks the job as cancelled and best-effort asks the upstream provider to stop. Does NOT refund compute already consumed. Returns 409 if the job is already in a terminal state.

post/v1/embeddings

Create vector embeddings for text input

OpenAI-compatible embeddings endpoint. Pass a single string or an array; receive one float (or base64) vector per input. Use `text-embedding-3-small` for cheap baselines and `text-embedding-3-large` for higher retrieval quality.

post/v1/audio/speech

Generate speech or queued music from text

Model-specific audio generation endpoint. Speech models return audio bytes synchronously. `minimax-music-v2` returns a 202 queue ticket and rejects speech-only fields such as `voice` and `speed`.

post/v1/audio/transcriptions

Transcribe audio into text

OpenAI-compatible multipart speech-to-text endpoint. The gateway returns JSON transcription responses.

get/v1/models

OpenAI-compatible model list

Returns every model the gateway can route to in OpenAI's `{object:'list', data:[…]}` shape, augmented with `available`, `display_name`, `description`, and `pricing`.

get/v1/models/catalog

SEO-friendly merged model catalog

Slug-friendly catalog used by aiduct.ai marketing pages. Includes pre-formatted price labels and a single-line price summary. Cached 60s.

get/v1/blog/posts

List published developer blog posts

Paginated list of `dev_blog_posts` rows with `status='published'`. Generated daily by the cron — see `/v1/blog/posts/{slug}` for full Markdown body.

get/v1/blog/posts/{slug}

Get one blog post by slug

Returns the full Markdown body alongside metadata.

get/v1/blog/categories

List blog categories

Each entry includes the published-post count for that category.