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.
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.
$ npm i -g @dcp/cli$ dcp login # paste your renter key once$ dcp run qwen2.5:7b "اشرح لي زكاة المال"$ dcp config set sovereign_only true # in-Kingdom only, no cross-border$ dcp pods launch --gpu rtx4090 --min 60 # whole GPU, per-second SAR$ dcp usage # spend + tokens, in SAR
$ curl https://api.dcp.sa/v1/chat/completions \-H "Authorization: Bearer $DCP_KEY" \-H "Content-Type: application/json" \-d '{ "model": "qwen2.5:7b", "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="qwen2.5:7b", 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: "qwen2.5:7b", messages: [{ role: "user", content: "اشرح لي زكاة المال" }],});
OpenAI-compatible API
DCP exposes an OpenAI-style inference surface at /v1. Production clients should first read the live catalog, select a model that is available now, and then call chat completions with the same request shape used by the official OpenAI SDKs.
GET /v1/modelslists verified-online models for OpenAI-compatible clients.POST /v1/chat/completionsruns the selected model and settles usage against the renter wallet.GET /api/models/catalogadds DCP catalog metadata such as task type, availability, and provider count.
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_KEYBilling & 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.
- Balance and burn rate live in Wallet.
- Per-job cost and history live in Usage.
- Per-job receipts for every charge are listed under Invoices.
Pricing
Public pricing lives at /pricing. The docs surface only names the contract: inference is metered per input and output token, pods are prepaid per GPU-second, persistent volumes are monthly, and the API returns 402 insufficient_balance before work starts when the wallet cannot cover the estimate.
Models
Do not hardcode capacity assumptions. The model list is earned from currently reachable providers, so clients should discover models at runtime and handle an empty or degraded catalog as a normal operational state.
$ curl https://api.dcp.sa/v1/models \-H "Authorization: Bearer $DCP_KEY"
Chat completions
POST /v1/chat/completions — the primary endpoint for conversational and instruction-following models.
| Parameter | Type | Description |
|---|---|---|
| model | string | The model to use, e.g. qwen2.5:7b. See the model list in your console. |
| messages | array | The conversation so far, as {role, content} objects. |
| stream | boolean | If true, partial tokens are sent as server-sent events. Default false. |
| temperature | number | Sampling temperature, 0–2. Lower is more deterministic. Default 0.7. |
| max_tokens | integer | Maximum 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
SDKs
For launch, use the official OpenAI SDKs directly with DCP's base URL and your DCP renter key. DCP-specific wrappers can be layered later, but production docs should keep the working path simple and vendor-compatible.
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.
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.
Provider onboarding
Providers enter from /earn, complete the setup wizard, install the daemon from the signed installer URL, and then manage rigs, payouts, and health from /provider/dashboard.
- Public CTA: earn with DCP.
- Setup wizard: provider setup.
- Operational console: provider dashboard.
GPU pods
Rent a whole GPU with root access, Jupyter, and SSH — prepaid per GPU-second 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.
Testing an inference server (vLLM, TGI)? Use the Experiment server preset in the pod console — it launches the pre-baked vLLM image on a time-boxed pod that cleans up its VRAM automatically when stopped. On provider nodes, experiments belong in pods, never bare on the machine: a hand-started server that parks VRAM blocks every pod launch until it is evicted.
$ 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 (MCP)
DCP is agent-first: it is built to be driven by agents and software, not only humans. An official Model Context Protocol (MCP) server lets any MCP-capable agent — Claude Desktop, Claude Code, Cursor, or your own — run sovereign in-Kingdom inference, rent a whole GPU, and keep persistent storage through native tool calls. Everything is prepaid in Riyal from one renter wallet.
An agent can mint its own key with no human: POST /api/renters/agent-register (no auth) returns a real dcp-renter- key plus a 20 SAR trial credit. Money routes accept an Idempotency-Key for safe retries and return a machine-readable HTTP 402 (insufficient_balance, required_sar, topup_url) when the wallet is short. The full narrative + copy-paste recipe live on the agent product page.
Install
The server runs over stdio via npx — there is nothing to install globally. Add it to your MCP client config (.mcp.json for Claude Code, claude_desktop_config.json for Claude Desktop, or your client's equivalent). Set DCP_API_KEY to your renter API key — both dcp-renter- and dc1-sk- prefixes are accepted (via Bearer or x-renter-key). Create one in the console under API keys, or let an agent mint one with no human via register_agent — see the agent guide.
// .mcp.json (Claude Code) · claude_desktop_config.json (Claude Desktop) · Cursor{"mcpServers": {"dcp": {"command": "npx","args": ["-y", "github:dhnpmp-tech/dcp-mcp"],"env": { "DCP_API_KEY": "dc1-sk-..." }}}}
DCP_API_KEY — your renter API key (required). DCP_API_BASE — API host, defaults to https://api.dcp.sa. Fund the wallet (SAR) and create a key at dcp.sa first.
Tools
The server exposes eleven native tools. The first, register_agent, is unauthenticated — an agent calls it with no key to mint its own (zero human). Inference is OpenAI-compatible; pods and volumes are prepaid per second / per month in Riyal, with unused pod time refunded on stop.
| Tool | What it does |
|---|---|
| register_agent | Self-register a new renter account in one unauthenticated call — a real dcp-renter- key plus a 20 SAR trial credit, no human and no email. Use first when no key is set. |
| list_models | List the models serveable right now (OpenAI-style entries; only available=true are live). |
| chat | Run an OpenAI-compatible chat completion — sovereign, in-Kingdom inference. Pick a model id from list_models. |
| get_balance | Get the renter wallet balance (SAR). Inference, pods, and volumes are all prepaid from it. |
| list_gpus | List rentable GPU TYPES right now (gpu_type + vram_gb + available + on_demand). Pick a gpu_type string to pass to create_pod — only the public NVIDIA label, no machine or vendor. |
| create_pod | Rent a whole GPU as an interactive pod (root + Jupyter + SSH), prepaid per second in SAR. Optional gpu_type (from list_gpus, e.g. 'H100'); omit to auto-pick. |
| get_pod | Get a pod's status and access details: status, access_url (Jupyter), ssh_command, ends_at, seconds_remaining. |
| extend_pod | Add time to a running pod without restarting it; the workspace and Jupyter token are unchanged. |
| stop_pod | Stop a pod early. Unused prepaid time is refunded to the wallet. |
| rent_volume | Rent an exclusive, in-Kingdom persistent volume (10/20/30 GB) so a pod's /workspace persists across pods and providers. |
| get_volume | Get the renter's active persistent volume (size, usage, price, pool availability). |
Example: an agent rents a GPU
Once the server is wired in, the agent rents and uses a GPU in three tool calls — no human in the loop. Describe the goal in plain language and the agent picks the tools.
# 1 · Rent a whole GPU for 30 minutes (prepaid in SAR)create_pod({ duration_minutes: 30 })// → { pod_id: "pod-...", status: "starting", quoted_sar: ... }# 2 · Poll until it is running, then open Jupyter / SSHget_pod({ pod_id: "pod-..." })// → { status: "running", access_url: "https://api.dcp.sa:.../?token=...",// ssh_command: "ssh ...", seconds_remaining: 1800 }# 3 · Stop early when done — unused minutes are refundedstop_pod({ pod_id: "pod-..." })// → { status: "stopped", refunded_sar: ... }
Agents can also self-discover DCP without MCP: read /llms.txt and /.well-known/ai-plugin.json at dcp.sa, plus the OpenAPI spec at /docs/openapi.yaml. The inference API is a drop-in OpenAI replacement at the base URL above.