Base URL and authentication
export CODERAI_URL="http://127.0.0.1:8776"
export CODERAI_TOKEN="your-api-token"
curl -s "$CODERAI_URL/v1/models" \
-H "Authorization: Bearer $CODERAI_TOKEN" | jq
CoderAI supports web sessions and API bearer tokens. Token management is available in the admin UI and via GET /admin/api/tokens and POST /admin/api/tokens. Interactive OpenAPI docs are served by a running instance at /docs, with raw schema at /openapi.json.
Core endpoints
| Method | Path | Purpose |
|---|
| GET | /v1/models | List configured models and metadata. |
| GET | /coderai/capabilities | Return broker/studio capability metadata and hardware summary. |
| GET | /v1/files/{filename} | Serve generated or uploaded files from the configured output directory. |
| GET | /v1/archive | List generated media in the output/archive directory. |
| DELETE | /v1/archive/{filename} | Delete one archived file. |
OpenAI-style text
curl -s "$CODERAI_URL/v1/chat/completions" \
-H "Authorization: Bearer $CODERAI_TOKEN" \
-H "Content-Type: application/json" \
-d '{"model":"Qwen/Qwen3-8B","messages":[{"role":"user","content":"Explain VRAM offloading."}],"temperature":0.4,"max_tokens":300}' | jq
POST /v1/chat/completions supports common OpenAI fields, streaming, tools, tool_choice, repeat penalty, and thinking templates where supported.POST /v1/completions supports legacy text completion clients.POST /v1/embeddings serves embeddings where a configured model supports them.
Multimodal routes
Images
/v1/images/generations/v1/images/edits/v1/images/inpaint/v1/images/upscale/v1/images/depth/v1/images/segment/v1/images/faceswap
Video
/v1/video/generations/v1/video/upscale/v1/video/subtitle/v1/video/interpolate/v1/video/dub
Audio
/v1/audio/transcriptions/v1/audio/speech/v1/audio/clone/v1/audio/convert/v1/audio/stems
Pipelines and profiles
/v1/pipelines/image-to-video/v1/pipelines/video-dub/v1/pipelines/story- Character, environment, voice profile CRUD APIs.
Data conventions
Media inputs generally accept HTTP URLs, CoderAI file URLs, raw base64, or data URLs such as data:image/png;base64,.... Generated media usually returns a data array with a url, or base64 keys such as b64_json, b64_mp4, b64_wav, or b64_mp3 when requested.
{"created":1781090000,"data":[{"url":"/v1/files/generated.png"}]}
OCR
A dedicated document-transcription subsystem built on real OCR engines. Full guide →
| Route | Purpose |
POST /v1/ocr | Transcribe an image or PDF. Fields: engine, dpi, structured, schema, detect. |
POST /v1/ocr/batch | Many files in one call; per-file errors reported inline. |
GET | POST /v1/ocr/schemas | List or create structured-extraction schemas. |
GET | PUT | DELETE /v1/ocr/schemas/{name} | Read, replace or delete one schema. |
Speech, speakers and audio
Full guide →
| Route | Purpose |
POST /v1/audio/transcriptions | Speech to text. language, target_language, timestamp_granularities, diarize, response_format (json/verbose_json/text/srt/vtt). |
POST /v1/audio/diarization | Who spoke when; identify=true relabels turns with enrolled names. |
POST /v1/audio/speakers · GET · DELETE /{name} | Enrol, list and remove named voiceprints. |
POST /v1/audio/speaker-identify · speaker-verify | Best match among the enrolled, or a yes/no against one of them. |
POST /v1/audio/speaker-embeddings | Raw voiceprint vectors, optionally windowed. |
POST /v1/audio/stems · cleanup | Demucs stem separation; DeepFilterNet denoise/normalise/de-hum/de-click. |
GET /v1/audio/progress | Audio-generation progress. |
Embeddings and reranking
Full guide →
| Route | Purpose |
POST /v1/embeddings | Text and image embeddings. Extras: image, embedding_types (dense/sparse/colbert), dimensions, quantization, encoding_format. |
POST /v1/rerank | Cross-encoder reranking: query + documents → relevance_score per document. |
LoRA training
| Route | Purpose |
POST /v1/loras/train | Train a LoRA against an image or video base. wait=false returns a job id. |
GET /v1/loras/progress | Progress by job, by session, or a global snapshot. |
POST /v1/loras/upload · GET /v1/loras/blob/{hash} | Content-addressed blob store, so a client can skip re-uploading. |
GET /v1/loras · GET | DELETE /v1/loras/{name} | List, read and delete registered LoRAs. |