DCPDocs
§ Get started

The DCP API.

OpenAI-compatible chat completions and model discovery, served from inside the Kingdom. If you’ve used the OpenAI SDK, you already know the core flow — change the base URL and the key, and you’re running Arabic-first inference on KSA-resident hardware, billed per token in Riyal.

Base URL

https://api.dcp.sa/v1 — drop-in compatible with the OpenAI chat-completions route. Model catalog and RAG endpoints are documented separately below.

Quickstart

Install the OpenAI SDK you already use, point it at DCP, and make your first call. Every request is billed per token against your wallet balance; new renter accounts start with SAR 100 of platform credit.

$ curl https://api.dcp.sa/v1/chat/completions \-H "Authorization: Bearer $DCP_KEY" \-H "Content-Type: application/json" \-d '{
     "model": "qwen3-4b",
     "messages": [{"role": "user", "content": "اشرح لي زكاة المال"}]
   }'
import osfrom openai import OpenAI client = OpenAI( base_url="https://api.dcp.sa/v1", api_key=os.environ["DCP_KEY"], ) resp = client.chat.completions.create( model="qwen3-4b", messages=[{"role": "user", "content": "اشرح لي زكاة المال"}], )print(resp.choices[0].message.content)
import OpenAI from "openai";const client = new OpenAI({baseURL: "https://api.dcp.sa/v1", apiKey: process.env.DCP_KEY,});const resp = await client.chat.completions.create({model: "qwen3-4b", messages: [{ role: "user", content: "اشرح لي زكاة المال" }],});

Authentication

All requests need a bearer token in the Authorization header. Create and manage keys in the console under API keys. Keys are scoped per workspace; use a separate key per service so you can revoke one without affecting the rest.

Authorization: Bearer $DCP_KEY

Billing & tokens

You pay per token — input and output are metered separately, and settled in halala-precision against your wallet. There’s no per-request minimum and no flat platform fee. Failed requests aren’t billed.

Chat completions

POST /v1/chat/completions — the primary endpoint for conversational and instruction-following models.

ParameterTypeDescription
modelstringThe model to use, e.g. qwen3-4b. See the model list in your console.
messagesarrayThe conversation so far, as {role, content} objects.
streambooleanIf true, partial tokens are sent as server-sent events. Default false.
temperaturenumberSampling temperature, 0–2. Lower is more deterministic. Default 0.7.
max_tokensintegerMaximum tokens to generate in the completion.

Embeddings

GET /api/models/catalog?task=embedding — standalone OpenAI-compatible embeddings are not exposed yet. Discover available embedding models through the catalog and use the managed RAG bundle for retrieval workflows.

$ curl https://dcp.sa/api/models/catalog?task=embedding \-H "Authorization: Bearer $DCP_KEY"

Reranking

Reranking is available as part of the Arabic RAG bundle and model catalog. A standalone public /v1/rerank route is not exposed in this frontend yet, so applications should call the managed RAG flow or compose retrieval server-side.

Streaming

Set stream=true on /v1/chat/completions to receive server-sent events. The stream ends with data: [DONE]. If a provider fails after headers are sent, DCP emits a terminal error frame instead of crashing the response.

Errors & limits

DCP returns JSON error bodies. The important renter cases are 401 for missing/invalid keys, 402 insufficient_balance when the pre-flight estimate exceeds available balance, 404 for unavailable models, 429 for rate limits, and 503 when no verified provider can serve the model.

Build a RAG app

Use the Arabic RAG model bundle for embeddings, reranking, and generation. The bundle endpoint reports whether BGE-M3, the reranker, and Arabic generation models are currently available.

$ curl https://dcp.sa/api/models/bundles/arabic-rag

Python SDK

Use the official OpenAI Python SDK with DCP's base URL.

Node.js SDK

Use the official OpenAI JavaScript SDK and set baseURL to https://api.dcp.sa/v1.

cURL / REST

Every SDK call maps to HTTPS requests with Authorization: Bearer $DCP_KEY.

Working in Arabic

DCP’s models are tuned Arabic-first. You can send Arabic directly in messages — no transliteration, no special encoding. Responses come back in clean Modern Standard Arabic. For mixed workloads, the models handle code-switching between Arabic and English naturally.

Data residency

Every request in this section is served from KSA-resident hardware by default. Cross-border frontier models are off unless you explicitly opt in. See Data residency.

Data residency

By default, your prompts, completions, and managed RAG artifacts stay in the Kingdom. Frontier (cross-border) models stay disabled until you turn them on per workspace — and when you do, every such request is marked so you always know where your data went.

§ Compute

GPU pods

Rent a whole GPU with root access, Jupyter, and SSH — prepaid per minute in Riyal, unused time refunded when you stop. Launch returns a pod id; poll it until status is running to get the Jupyter URL and SSH command.

$ curl https://api.dcp.sa/api/pods \-H "Authorization: Bearer $DCP_KEY" \-d '{"duration_minutes": 60}'$ curl https://api.dcp.sa/api/pods/$POD_ID$ curl -X POST https://api.dcp.sa/api/pods/$POD_ID/extend -d '{"extend_minutes": 30}'$ curl -X DELETE https://api.dcp.sa/api/pods/$POD_ID

Persistent volumes

Rent an exclusive, in-Kingdom persistent volume (10/20/30 GB, billed monthly in Riyal). With an active volume, a pod's /workspace is restored on launch and snapshotted on stop — your files persist across pods and across providers. Without one, pods are ephemeral.

$ curl https://api.dcp.sa/api/volumes/rent -H "Authorization: Bearer $DCP_KEY" -d '{"size_gb": 20}'$ curl https://api.dcp.sa/api/volumes/me
§ Agents

Use DCP from an agent

DCP is built to be used by agents and software, not only humans. The inference API is a drop-in OpenAI replacement (point any OpenAI SDK at the base URL above), and an official Model Context Protocol (MCP) server lets an MCP-capable agent — Claude, Cursor, or your own — run inference, rent GPUs, and manage storage through native tool calls.

// MCP client config (Claude Desktop / Claude Code / Cursor){ "mcpServers": { "dcp": {"command": "npx", "args": ["-y", "@dcp/mcp"],"env": { "DCP_API_KEY": "dcp-renter-..." }} } }

Discovery: agents can read /llms.txt and /.well-known/ai-plugin.json at dcp.sa, plus the OpenAPI spec at /docs/openapi.yaml. MCP tools: list_models, chat, create_pod, get_pod, extend_pod, stop_pod, rent_volume, get_volume, get_balance.