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

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.

Which worker served a request

Every successful JSON reply (chat, messages, responses, embeddings, reranking, moderations, images, transcriptions and speech) names the worker that ran it in a pendra field, which OpenAI and Anthropic clients ignore:

"pendra": {"worker": {"id": "wrk-1a2b3c4d", "name": "london-gpu-01", "version": "3.115.1"},
           "request_id": "3f1c8a2e-5b7d-4e19-9c0a-6d2f8b1e4a73"}

Streamed chat completions carry it on the last chunk before [DONE]. Non-streaming replies also send it as the X-Worker-Id and X-Worker-Name headers, and the responses that aren't JSON only there: plain-text transcripts (text, srt, vtt) and WAV speech. A stream sends the two headers as well when a worker is free straight away. See Which worker served the request.

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".

To confirm from your own code that a cancelled request has stopped (for example before an unattended service retries it), use a key with the Usage & workers permission and check the in-progress requests list.

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.