API Reference
Every supported endpoint, its parameters, and the errors you may see.
Supported endpoints
All examples use the public API base https://origamiaai.vercel.app/v1.
| Method | Endpoint | Description | Capability |
|---|---|---|---|
| GET | /v1/models | List public models available to the key. | Catalog |
| POST | /v1/chat/completions | OpenAI-compatible chat completions with SSE streaming. | Text, vision, tools |
| POST | /v1/messages | Anthropic Messages requests with SSE streaming. | Text, vision, tools |
| POST | /v1/responses | Stateless OpenAI Responses requests and streams. | Responses |
| POST | /v1/embeddings | Create vector embeddings. | Embeddings |
| POST | /v1/moderations | Classify text with a moderation model. | Moderation |
| POST | /v1/rerank | Rerank documents against a query. | Rerank |
| POST | /v1/images/generations | Generate one or more images from a prompt. | Image generation |
| POST | /v1/images/edits | Edit an uploaded image with multipart form data. | Image edits |
| POST | /v1/images/variations | Create variations of an uploaded image. | Image variations |
| POST | /v1/videos | Create an asynchronous video job. | Video generation |
| GET | /v1/videos/{video_id} | Read the current video job state. | Video generation |
| DELETE | /v1/videos/{video_id} | Cancel or delete a video job. | Video generation |
| GET | /v1/videos/{video_id}/content | Download completed video content. | Video generation |
| POST | /v1/audio/speech | Synthesize speech and return audio bytes. | Audio speech |
| POST | /v1/audio/transcriptions | Transcribe an uploaded audio file. | Audio transcription |
| POST | /v1/files | Upload a file for a model or batch workflow. | Files |
| GET | /v1/files | List files available to the API key. | Files |
| GET | /v1/files/{file_id} | Retrieve file metadata. | Files |
| DELETE | /v1/files/{file_id} | Delete a stored file. | Files |
| GET | /v1/files/{file_id}/content | Download file content. | Files |
| POST | /v1/batches | Create a 24-hour asynchronous batch. | Batch |
| GET | /v1/batches | List batches available to the API key. | Batch |
| GET | /v1/batches/{batch_id} | Retrieve a batch and its output file IDs. | Batch |
| POST | /v1/batches/{batch_id}/cancel | Cancel a non-terminal batch. | Batch |
Text, responses, embeddings, and safety
Anthropic Messages
1curl "https://origamiaai.vercel.app/v1/messages" \2 -H "x-api-key: $ORIGAMI_API_KEY" \3 -H "anthropic-version: 2023-06-01" \4 -H "content-type: application/json" \5 -d '{6 "model": "YOUR_PUBLIC_MODEL",7 "max_tokens": 256,8 "messages": [{"role": "user", "content": "Explain the gateway in one sentence."}]9 }'
Responses API
1curl "https://origamiaai.vercel.app/v1/responses" \2 -H "Authorization: Bearer $ORIGAMI_API_KEY" \3 -H "Content-Type: application/json" \4 -d '{"model":"YOUR_RESPONSES_MODEL","input":"Summarize this request","store":false}'
Responses are stateless: omit previous_response_id and conversation. Chat Completions, Messages, and Responses support SSE when stream: true and the selected route supports streaming.
/v1/embeddingsRequired: model, input. Optional: dimensions, encoding_format.
/v1/moderationsRequired: model, string or string-array input.
/v1/rerankRequired: model, query, documents. Optional: top_n, return_documents.
Image, video, and audio APIs
POST /v1/images/generationsJSON with model, prompt, and optional n, size, quality, or inference steps.
POST /v1/images/editsMultipart fields: model, image or file, required prompt, plus optional image controls.
POST /v1/images/variationsMultipart fields: model, image or file, plus optional image controls.
POST /v1/audio/speechJSON with model, input, voice, and optional response format or speed.
POST /v1/audio/transcriptionsMultipart fields: model, audio file, and optional fields supported by the selected model.
POST /v1/videosJSON or multipart with model, prompt, and optional seconds, size, fps, or reference media.
Create and poll a video job
1VIDEO_ID=$(curl -s "https://origamiaai.vercel.app/v1/videos" \2 -H "Authorization: Bearer $ORIGAMI_API_KEY" \3 -H "Content-Type: application/json" \4 -d '{"model":"YOUR_VIDEO_MODEL","prompt":"City lights at dusk","seconds":"4","size":"1280x720"}' \5 | jq -r '.id')67curl "https://origamiaai.vercel.app/v1/videos/$VIDEO_ID" \8 -H "Authorization: Bearer $ORIGAMI_API_KEY"
Files and asynchronous batches
- 1
Prepare an OpenAI-compatible JSONL input file. Each request must target the same public model supplied during upload.
- 2
Upload it to
POST /v1/fileswith multipart fieldsfile,purpose=batch, andmodel. - 3
Create a batch with
input_file_id, a supported endpoint, andcompletion_window: "24h". - 4
Poll the batch, then download
output_file_idorerror_file_idfrom the file content endpoint.
Supported batch targets are /v1/responses, /v1/chat/completions, /v1/embeddings, and /v1/moderations. File and batch access follows the key's account permissions.
Errors and response headers
OpenAI-compatible routes return an error object. The Messages route returns the Anthropic error envelope.
| Status | Typical code | What to check |
|---|---|---|
| 400 | invalid_request_error | Malformed JSON, unsupported parameter, or policy rejection. |
| 401 | invalid_api_key | Missing, revoked, expired, or unknown virtual key. |
| 403 | origin_not_allowed | The API key or browser-origin policy denied the call. |
| 404 | not_found / model_not_found | Model, file, batch, or video resource was not found. |
| 409 | idempotency_* | The idempotency key is active, not replayable, or has a different payload. |
| 413 | request_too_large | Request exceeds the configured modality body limit. |
| 422 | guardrail_rejected | A configured safety policy rejected the response. |
| 429 | rate_limit_exceeded | A request, token, concurrency, or budget limit was reached. |
| 502 | provider_error | The service could not complete the model request. |
Successful gateway responses may include X-Request-ID and standard plus compatibility rate-limit headers. A 429 may also include Retry-After.