Documentation

Build with Pendra

OpenAI-compatible SDKs for sovereign UK inference. Your data stays in the UK — your code stays the same.

Get started in minutes

Install the SDK, create a client with your API key, and make your first request. That's it.

1
Install the SDK
2
Get an API key
3
Make your first request
quickstart.py
from pendra import Pendra

client = Pendra(api_key="pdr_sk_...")

response = client.chat.completions.create(
    model="llama3.2",
    messages=[{"role": "user", "content": "Hello!"}]
)

print(response.choices[0].message.content)

OpenAI Compatible

Same interface as the OpenAI SDK. Switch your import and base URL — everything else stays the same.

UK Data Sovereignty

All data processed in UK data centres. Never stored, never shared with US cloud providers.

Self-Hosted Workers

Run inference on your own GPUs. Deploy a worker with a single command.

REST API

All SDKs communicate with the same REST API. Base URL: https://api.pendra.ai/api/v1

Endpoint Description
POST /api/v1/chat/completions Create a chat completion (streaming or non-streaming)
POST /api/v1/images/generations Generate an image from a text prompt (Python · Node.js)
POST /api/v1/embeddings Create vector embeddings for retrieval and RAG (Python · Node.js)
GET /api/v1/models List available models. Filter with ?type=chat|image|embedding.
GET /api/v1/usage/summary Aggregated usage statistics
GET /api/v1/usage/daily Daily usage breakdown
GET /api/v1/usage/logs Individual request logs

Example request

curl
curl https://api.pendra.ai/api/v1/chat/completions \
  -H "Authorization: Bearer pdr_sk_..." \
  -H "Content-Type: application/json" \
  -d '{"model":"llama3.2","messages":[{"role":"user","content":"Hello"}]}'

Image generation

curl
curl https://api.pendra.ai/api/v1/images/generations \
  -H "Authorization: Bearer pdr_sk_..." \
  -H "Content-Type: application/json" \
  -d '{"model":"x/z-image-turbo","prompt":"A sunset","size":"1024x1024"}'

Embeddings

Create vector embeddings for retrieval, search, and RAG pipelines. Accepts a single string or a batch of strings and returns one vector per input.

curl
curl https://api.pendra.ai/api/v1/embeddings \
  -H "Authorization: Bearer pdr_sk_..." \
  -H "Content-Type: application/json" \
  -d '{"model":"nomic-embed-text:latest","input":"The quick brown fox"}'