API reference

The Pendra API is a REST API at https://api.pendra.ai. The Python and Node SDKs are the easiest way to call it. This reference is for calling it directly, or from an OpenAI or Anthropic client.

Base URL

Endpoints live under /api/v1. The inference endpoints also answer under /v1, so an OpenAI or Anthropic client works if you set its base URL to https://api.pendra.ai/v1 and use a Pendra API key.

https://api.pendra.ai/v1

Every request sends that key as a bearer token. See Authentication.

Endpoints

The full schema is at /api/v1/openapi.json.

Which worker served a request

Every JSON reply has a pendra field naming the worker that ran it and the request id to quote to support. OpenAI and Anthropic clients ignore it.

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

A stream carries it on the last chunk. Replies that aren't JSON, such as audio, send the X-Worker-Id and X-Worker-Name headers instead.

Cancel a request

Close the connection. Pendra stops the model straight away and frees the GPU for the next request, for streams and normal requests alike. In JavaScript, use an AbortController:

const controller = new AbortController();

client.chat.completions.create(
  { model: 'qwen3.6:27b', messages: [{ role: 'user', content: 'Write an essay' }] },
  { signal: controller.signal },
);

controller.abort();

A cancelled request shows in the usage log with status 499. To check from code that it has stopped, see In-progress requests.