API Reference
API reference
The Pendra REST API is OpenAI-compatible. Base URL:
https://api.pendra.ai
Most endpoints live under /api/v1. The Anthropic-compatible
surface (/v1/messages) and the OpenAI Responses API
(/v1/responses) are mounted at the /v1 root so
the official Anthropic and OpenAI SDKs work without any base-URL
surgery. Audio transcription answers on both paths.
Interactive Swagger UI is available at https://api.pendra.ai/api/v1/docs,
ReDoc at /api/v1/redoc, and the raw OpenAPI schema at
/api/v1/openapi.json.
Endpoints
Chat completions
OpenAI-compatible chat. Streaming and non-streaming.
Embeddings
Vector embeddings for retrieval and RAG.
Rerank
Reorder documents by relevance to a query.
Images
Generate an image from a prompt.
Audio transcription
Whisper-class speech-to-text. Multipart upload.
Models & catalogue
List live models and the public Pendra catalogue.
Anthropic Messages
Anthropic-compatible endpoint for Claude SDKs.
Responses (Codex)
OpenAI-compatible Responses API for Codex.
Authentication
Every request needs a Pendra API key (pdr_sk_…), sent as a
bearer token. The Anthropic-compatible /v1/messages endpoint
also accepts the x-api-key header. See
Authentication for full details.
Errors & rate limits
Pendra returns standard HTTP status codes. Errors carry a JSON body and a
X-Request-Id response header you can paste to support. See
Errors & rate limits.
Cancelling a request
To cancel an in-flight request, close the connection. There is no separate cancel endpoint — aborting the HTTP request is the cancellation mechanism, and it works for both streaming and non-streaming calls. Pendra stops the generation on your GPU and frees the slot straight away, so the next request doesn't wait behind work nobody is reading.
Every OpenAI- and Anthropic-shaped SDK exposes this. In Python, pass a
timeout or close the client; in JavaScript, use an AbortController:
const controller = new AbortController();
const request = client.chat.completions.create(
{ model: 'qwen3.6:27b', messages: [{ role: 'user', content: 'Write an essay' }] },
{ signal: controller.signal },
);
// Changed your mind — stop the generation and release the GPU.
controller.abort();
Cancelled requests appear in your dashboard usage log with status
499 and the note "Client disconnected".
Capabilities
New to a feature? The Capabilities guides walk through chat, thinking, tool calling, structured outputs, vision, OCR, embeddings, reranking, image generation, and audio transcription with worked examples. This reference is the field-by-field companion.
SDKs
Pendra ships OpenAI-shaped SDKs: Python and Node. The OpenAI and Anthropic SDKs also work — just change the base URL and API key.