Connect your tools
- Create an API key and copy it.
- Pick the tool you use below.
- Copy its settings and swap
your DeepXRoute API keyfor your key.
API reference
Import the OpenAPI 3.1 document into your API client to explore requests, response fields and errors for text generation, models, key status, usage, wallet balance, media jobs and management operations.
Download the OpenAPI document (JSON)
The document contains no credentials. Add your key locally as a bearer token; never include it in a shared collection or URL. Its default server is the production API—change the server explicitly when testing another environment. Signing up, payments and invoices are managed in the console.
# Public schema; no API key required:
GET https://api.deepxroute.com/v1/openapi.json
# For API requests, send one authentication header:
Authorization: Bearer <your DeepXRoute API key>
# Alternative: x-api-key: <your DeepXRoute API key>Each text-generation POST is a new request. Disable automatic SDK retries: a timeout can leave credit held while usage is checked. For media, save the submission UUID and reuse it with the same content after an uncertain response. Check the job before starting another generation. A successful key check does not activate provisional pricing or add wallet credit.
Claude Code
Set these environment variables in your local tool configuration. Use your DeepXRoute key as the authentication token.
ANTHROPIC_BASE_URL=https://api.deepxroute.com
ANTHROPIC_AUTH_TOKEN=<your DeepXRoute API key>
ANTHROPIC_MODEL=qwen3.8-max
ANTHROPIC_DEFAULT_SONNET_MODEL=qwen3.8-max
ANTHROPIC_DEFAULT_OPUS_MODEL=qwen3.8-max
ANTHROPIC_DEFAULT_HAIKU_MODEL=glm-5.3
CLAUDE_CODE_GATEWAY_HINT_HEADERS=1
CLAUDE_CODE_AUTO_MODE_SERVER=0CLAUDE_CODE_GATEWAY_HINT_HEADERS=1 marks Claude Code's side requests (auto-mode safety checks, session titles, summaries). They are free up to $1 a day per account and charged at normal prices after that. CLAUDE_CODE_AUTO_MODE_SERVER=0 stops Claude Code from asking for Anthropic's server-side auto-mode checks, which DeepXRoute models cannot provide.
Remove a conflicting ANTHROPIC_API_KEY override from that configuration. Restart Claude Code after updating the environment.
Codex
Set DEEPXROUTE_API_KEY securely in your environment, then add this provider to your Codex configuration. Back up existing settings before editing them.
model = "qwen3.8-max"
model_provider = "deepxroute"
[model_providers.deepxroute]
name = "DeepXRoute"
base_url = "https://api.deepxroute.com/v1"
env_key = "DEEPXROUTE_API_KEY"
wire_api = "responses"OpenCode
Set DEEPXROUTE_API_KEY in your environment, then save this as opencode.json in your project (or ~/.config/opencode/opencode.json for every project). The output limit matches the models' 65,536-token maximum.
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"deepxroute": {
"npm": "@ai-sdk/openai-compatible",
"name": "DeepXRoute",
"options": {
"baseURL": "https://api.deepxroute.com/v1",
"apiKey": "{env:DEEPXROUTE_API_KEY}"
},
"models": {
"qwen3.8-max": {
"name": "Qwen3.8 Max",
"limit": { "context": 128000, "output": 65536 }
},
"glm-5.3": {
"name": "GLM-5.3",
"limit": { "context": 128000, "output": 65536 }
}
}
}
},
"model": "deepxroute/qwen3.8-max",
"small_model": "deepxroute/glm-5.3"
}Start OpenCode and run /models: Qwen3.8 Max and GLM-5.3 appear under DeepXRoute. Instead of the environment variable, you can run /connect, choose Other, enter deepxroute as the provider ID and paste your key, then remove the apiKey line.
OpenCode Desktop
The desktop app opens from the Dock or Start menu, so it does not see shell variables such as DEEPXROUTE_API_KEY. Put your key in the user-level config instead: ~/.config/opencode/opencode.json on macOS and Linux, %USERPROFILE%\.config\opencode\opencode.json on Windows. This example lists every chat model; replace YOUR_API_KEY with your key.
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"deepxroute": {
"npm": "@ai-sdk/openai-compatible",
"name": "DeepXRoute",
"options": {
"baseURL": "https://api.deepxroute.com/v1",
"apiKey": "YOUR_API_KEY"
},
"models": {
"qwen3.8-max": {
"name": "Qwen3.8 Max",
"tool_call": true,
"limit": {
"context": 128000,
"output": 65536
}
},
"qwen3.8-max-unfiltered": {
"name": "Qwen3.8 Max Unfiltered",
"tool_call": true,
"limit": {
"context": 128000,
"output": 65536
}
},
"qwen3.8-flash": {
"name": "Qwen3.8 Flash",
"tool_call": true,
"limit": {
"context": 128000,
"output": 65536
}
},
"qwen3-vl-plus": {
"name": "Qwen3-VL Plus",
"tool_call": true,
"attachment": true,
"modalities": {
"input": [
"text",
"image"
],
"output": [
"text"
]
},
"limit": {
"context": 128000,
"output": 65536
}
},
"glm-5.3": {
"name": "GLM-5.3",
"tool_call": true,
"limit": {
"context": 128000,
"output": 65536
}
},
"deepseek-v4-pro": {
"name": "DeepSeek V4 Pro",
"tool_call": true,
"limit": {
"context": 128000,
"output": 65536
}
},
"deepseek-v4-flash": {
"name": "DeepSeek V4 Flash",
"tool_call": true,
"limit": {
"context": 128000,
"output": 65536
}
},
"deepseek-v4.1-flash": {
"name": "DeepSeek V4.1 Flash",
"tool_call": true,
"attachment": true,
"modalities": {
"input": [
"text",
"image"
],
"output": [
"text"
]
},
"limit": {
"context": 128000,
"output": 65536
}
}
}
}
},
"model": "deepxroute/qwen3.8-max",
"small_model": "deepxroute/qwen3.8-flash"
}Quit OpenCode completely and reopen it, then pick a DeepXRoute model in the model picker. Qwen3-VL Plus and DeepSeek V4.1 Flash read pasted images. Keep this file in your user folder only: never copy it into a project, a repository or a shared drive. If it leaks, revoke the key under API keys and create a new one.
Cursor
Cursor can send chat requests to DeepXRoute with its OpenAI key and base URL override. Open Cursor Settings, go to Models and set:
Cursor Settings → Models
OpenAI API Key on → <your DeepXRoute API key>
Override OpenAI Base URL on → https://api.deepxroute.com/v1
Add model qwen3.8-max
Add model glm-5.3Then choose qwen3.8-max in the model picker. Click Verify if Cursor asks; it sends one small test request.
This needs a paid Cursor plan and works for chat-style requests. Tab autocomplete, and some agent features, keep using Cursor's own models. While the override is on, Cursor sends its OpenAI-type requests to DeepXRoute, so turn it off to switch back to Cursor's built-in OpenAI models.
Compatible SDKs
Use https://api.deepxroute.com/v1 as your base URL and your DeepXRoute key for bearer authentication. Choose an available model from the console’s price list.
Text, streaming and client-executed function calls are supported. Image and video generation use the separate media endpoints below. Audio, image inputs to chat, background responses and server-hosted tools are not supported.
Find a model and its API example
Compare models and prices on the public models page. Search and filter the catalog through the API, as below. Prices and limits come from the current platform configuration.
GET https://api.deepxroute.com/v1/models
Authorization: Bearer <your API key>
# Include text, image and video:
GET /v1/models?output_modalities=all
GET /v1/models?output_modalities=image&availability=active
GET /v1/models?q=qwen
GET /v1/models/qwen3.8-maxThe default list contains text models. Your key’s model allowlist applies to lists and detail lookups. List results are in data; a detail lookup returns one model. Metadata includes gateway endpoints, input/output modalities, configured limits, and pricing in integer nanoUSD strings. Text prices are per token; media prices are per output and size. Divide by 1,000,000,000 to obtain USD. Availability can be active, preview or unavailable. Preview pricing does not enable requests. Discovery is limited to 60 reads per minute per account.
Image & video API
Use the same bearer key with /v1/media/catalog to check activation and prices. Submit to /v1/media/jobs, then poll your jobs and download the completed asset. Outputs are kept until you delete them with DELETE /v1/media/jobs/{id}/asset.
POST https://api.deepxroute.com/v1/media/jobs
Authorization: Bearer <your API key>
Content-Type: application/json
{
"idempotencyKey": "<new UUID for this generation>",
"model": "wan-3.0",
"size": "1920x1080",
"duration": 5,
"prompt": "A lighthouse at dawn, waves rolling in"
}
GET /v1/media/jobs/<job-id>
GET /v1/media/jobs/<job-id>/assetReuse the same submission UUID if a connection fails; changing the content requires a new UUID. A job under review holds credit until checked. For a five-second video, use wan-3.0 with size 1920x1080; add duration 10 or 15 for a longer one where that length is priced. See the public models page for currently offered variants and pricing.
Start a video from your own images
Upload the images first (see Upload an image below), then send their upload ids in input_images. Wan 3.0 takes one to ten images with input_mode: first_frame (one image; the default when you send one), first_last_frame (two images) or reference (one to ten images of people, products or places, named image 1, image 2 and so on in the prompt). Use size 480P, 720P or 1080P with an optional aspect_ratio, or a pixel size. With a first frame the video follows the image's aspect ratio. Images must be 300 to 8000 pixels per side; frames need an aspect ratio between 0.4 and 2.5.
POST https://api.deepxroute.com/v1/media/jobs
{
"idempotencyKey": "<new UUID for this generation>",
"model": "wan-3.0",
"size": "720P",
"aspect_ratio": "9:16",
"duration": 5,
"prompt": "The woman in image 1 holds the flowers from image 2",
"input_images": ["<upload id 1>", "<upload id 2>"],
"input_mode": "reference"
}Embeddings for search & retrieval
Embeddings are not enabled on DeepXRoute yet; this guide applies once they are. Convert text into numeric vectors for similarity search and retrieval. List the embedding models with GET /v1/embeddings/models (example below) for each model’s input price and limits.
curl --fail-with-body https://api.deepxroute.com/v1/embeddings/models \
-H "Authorization: Bearer $DEEPXROUTE_API_KEY"Text batches are supported. Token arrays are accepted only when the model advertises them and no content filter applies. The service checks both per-input and total token/byte limits. Multimodal embeddings are not available. To rank retrieved documents, see Reranking for search.
Price and privacy
Embedding prices are USD per input token. Output tokens cost zero. Credit is reserved for the exact filtered input, and usage must agree before it is charged. API-key, account, team and guardrail limits still apply. Provider controls support eligible supplier selection, BYOK and reviewed privacy requirements; saved platform-spending consent remains authoritative.
Use the model example to select a stricter privacy requirement. Account rules cannot be lowered, and your key or member rules may be stricter. Text and vectors are not stored in usage history. Base64 vectors contain little-endian float32 components.
Recover an uncertain request
Save the x-request-id response header. On a timeout, disconnect or invalid supplier result, inspect Usage with Type set to embedding. Credit may be held for review. A repeated POST is a new request and can incur another charge; copied SDK examples disable automatic retries.
Use session_id or x-session-id to group related requests. Usage stores an account-specific reference; the raw ID is not forwarded. Embeddings do not use response caching or streaming.
Reranking for search
Reranking is not enabled on DeepXRoute yet; this guide applies once it is. Improve retrieval by scoring a shortlist of documents against a query. Retrieve candidates with your search system, rerank them, then send the highest-ranked passages to your chat model. Reranking returns scores and document indices; it does not generate an answer.
curl --fail-with-body https://api.deepxroute.com/v1/rerank/models \
-H "Authorization: Bearer $DEEPXROUTE_API_KEY"An empty list means no reranking model is configured or visible to your key. Provisional and inactive models cannot serve requests. Examples only prepare requests; copying them does not send data or spend credit.
Search units and held credit
Prices are USD per supplier-reported search unit, separate from chat and embedding tokens. Document count does not determine the final charge. Credit is reserved up to the model’s published maximum, then settled only against verified usage. BYOK incurs the disclosed routing fee plus a separate supplier bill. Account, key, team and privacy restrictions apply.
Results use zero-based indices into your submitted documents, ordered by decreasing relevance score. A score is not a probability. When you request returned text, it reflects content filtering. Queries, documents and rankings are not stored in usage history.
Recover an uncertain request
Save the x-request-id response header. If a request times out or the supplier response cannot be verified, open Usage, select Type → rerank and inspect its status and held credit. Contact your operator with the request reference if it needs review. A repeated POST is a new request and may incur another charge; the examples do not retry automatically.
Upload images for video
Upload images to use as a video’s first or last frame, or as reference images. Uploads and the selected model must be activated. Check the public models page for current sizes and prices before submitting.
- Upload with the application API key that will submit generation. PNG, JPEG and WebP files can be up to 10 MiB. The service validates them, strips metadata and stores a private PNG; original bytes are sent to DeepXRoute.
- Save the response’s
id. Paste it into the model’s Input upload IDs field to create cURL, JavaScript or Python examples. Pass the IDs ininput_images: Wan 3.0 takes one (first frame), two (first and last frame) or up to ten reference images. - Use a separate saved UUID for generation. Submit once, poll the returned job ID, then download the result. The price matches the chosen size and duration; an unpriced combination is unavailable.
Upload through your API key
Set DEEPXROUTE_API_KEY through your environment or secret manager. Generate an upload UUID once, for example with uuidgen, and save it as DEEPXROUTE_UPLOAD_KEY. Place your PNG at input.png; for another supported format, change both the filename and Content-Type.
# Save a UUID once in DEEPXROUTE_UPLOAD_KEY before the first attempt.
# Reuse that UUID, the same file bytes and the same API key after uncertainty.
: "${DEEPXROUTE_API_KEY:?Set your API key in the environment}"
: "${DEEPXROUTE_UPLOAD_KEY:?Set your saved upload UUID}"
curl --fail-with-body --max-time 40 \
https://api.deepxroute.com/v1/media/uploads \
-H "Authorization: Bearer $DEEPXROUTE_API_KEY" \
-H "Idempotency-Key: $DEEPXROUTE_UPLOAD_KEY" \
-H 'Content-Type: image/png' \
--data-binary @input.pngThe same UUID, bytes and key recover the same upload. Uploading reserves no credit; generation is paid. A successful upload does not guarantee that the image meets the model’s stricter byte, dimension and aspect-ratio limits.
Upload with the key that will use the image
An API key can attach only its own uploads. Upload through the same key that submits the generation; an upload ID from another key is refused.
Get notified when media finishes
Add a completion webhook to an image or video job so your server can receive its final state. Polling still works. Signed callbacks require platform activation; they are separate from Stripe payment webhooks.
- Add
webhook_urlto your image or video job request with a public HTTPS receiver you control. The media API examples show the request shape. - Save your submission UUID and the returned job ID in your application. The request uses
webhook_url; keep that URL and all other content unchanged for a same-UUID retry. - Verify each notification, match its job ID to a job your application submitted, and durably deduplicate its event ID before returning 2xx. Process the saved event in the background.
Verify before processing
Fetch Ed25519 public keys from the DeepXRoute JWKS endpoint. Cache them briefly; refresh once for an unknown key ID and rate-limit refreshes. Use that fixed URL, never a URL supplied by the sender. Keep the exact raw request body and allow a five-minute timestamp window.
The signed message is timestamp + "." + raw body. Read x-dxr-webhook-timestamp, x-dxr-webhook-key-id and x-dxr-webhook-signature. Compare the event body’s id and type with x-dxr-webhook-id and x-dxr-webhook-event.
Read the result and recover delivery
The media.job.terminal event contains data.id (your job), its completed/failed/cancelled state, model, optional session reference and exact cost in nanoUSD. One USD is one billion nanoUSD. Review holds wait for resolution. Prompts, keys and supplier URLs are omitted.
Use the originating API key to fetch /v1/media/jobs/{id} or its /asset path. Downloads stay private and keep their original expiry; a delayed callback does not extend retention.
Longer videos and short movies
One generation makes up to 30 seconds with any Wan 3.0 model, Prime and unfiltered included. For a longer video or a short movie, generate several clips here and join them on your own computer. DeepXRoute generates the clips; joining, trimming and music happen on your device, free.
- Generate each scene as its own clip. Use the same model, size and length for every scene, and the same reference photos (tag them with @), so the character and look stay consistent.
- To make one scene carry on from the last, take the last frame of the previous clip (command 1 below) and upload it as the next clip's first frame (
first_frame, or the first-frame photo in Create). - Download the clips and join them in order, then add music if you like.
The easy way: ask an AI assistant
An AI coding assistant on your computer, such as Claude Code, can install ffmpeg and do the joining for you. Put the clips and your music in one folder, open the assistant there and paste a request like this:
I have video clips scene1.mp4, scene2.mp4 and scene3.mp4 in this folder.
Use ffmpeg to join them in that order into movie.mp4, then add music.mp3
under it at low volume. Install ffmpeg first if it is missing.Joining clips is not charged. You pay only for the clips you generate, at the normal price.
Usage & billing API
Use /v1/key to check your key’s budget, expiry and model access. Usage reports default to the calling key. To read account-wide usage or the wallet balance, explicitly enable Allow account-wide billing read access when creating or managing the key.
GET https://api.deepxroute.com/v1/usage/report?start=2026-10-01&end=2026-11-01&groupBy=model
Authorization: Bearer <your API key>
GET /v1/usage/records?start=2026-10-01&end=2026-11-01&page=1
GET /v1/usage/export?start=2026-10-01&end=2026-11-01
# Requires account billing read access:
GET /v1/usage/report?scope=account&groupBy=key
GET /v1/usage/report?scope=account&groupBy=member
GET /v1/billing/balanceReplace the example dates with your reporting period. UTC start is inclusive and end is exclusive, with a maximum of 180 days. Omit both to use this month through today. Group by day, model, key, model-key or day-model-key. Team breakdowns also support member, day-member and model-member. Filter with kind, state, model, keyId and memberId. Lists return items, hasMore and page; increment page while hasMore is true.
Team owners, administrators and finance members can choose a member in Usage, group costs by member, and open that member’s individual requests. Removed members retain their historical attribution. Developers and viewers see only their own activity. API reports and CSV use immutable member_id values without member email addresses; copy an ID from a report to filter with memberId. Console activity retains its member ID even when its internal key is hidden. A member filter always narrows the caller’s existing access.
JSON amounts are integer strings in nanoUSD: divide by 1,000,000,000 to obtain USD. CSV amounts are exact USD decimals. Finished requests use their settlement date; pending and review requests use their start date. Holds in a report cover only its selected dates and filters. The wallet balance endpoint reports all current holds.
Individual records and CSV include requested_model, the first model you requested. The record’s model is the last recorded model, and the billed model when completed. Open “Routing attribution” in Usage to inspect it. The preset_id, preset_version and preset_slug fields are historical and stay empty since presets were removed.
Reports are limited to 60 reads per minute per account; CSV exports allow six per minute and up to 10,000 rows. Narrow the dates or filters if an export is too large. API keys cannot change account settings through these read endpoints.
Understand supplier cache charges
Supplier prompt caching reuses input at the supplier. It can still incur a charge for reads, writes and output. DeepXRoute response caching instead reuses a completed response without a new supplier call or charge.
In Usage, open “Token breakdown & prices” to see measured fresh input, cache reads and cache writes beside the original selling prices. “Supplier cache coverage” shows how many completed calls reported a breakdown. Unreported usage is unknown, not zero. Media, open work and reused responses are excluded from this coverage.
curl https://api.deepxroute.com/v1/usage/records \
-H "Authorization: Bearer $DEEPXROUTE_API_KEY"
curl 'https://api.deepxroute.com/v1/usage/report?groupBy=model' \
-H "Authorization: Bearer $DEEPXROUTE_API_KEY"These reads default to the current key and month. Account-wide access requires billing-read permission and scope=account. Use the usage and billing reference for date filters, pagination and CSV exports.
prompt_cache_usagecontains measured input classes; null means unavailable or inapplicable. Fresh input + cache reads + total cache writes equals input tokens. Write durations partition total writes; do not count them twice.token_pricesholds the record’s original rates as integer nanoUSD per token, alongsideprice_version. Current model prices cannot reprice history. Null applies to media and response-reuse hits.- A null
token_prices.prompt_cachemeans all input uses the flat input rate, even if cache usage was measured. A null duration rate falls back to the explicit flat write rate. Missing applicable rates or missing required measurements leave credit held for review. - CSV retains these classes and prices. Unknown values are blank; known zero values are 0. Grouped sums cover only measured calls and include measured/unreported call counts.
Rates and reported measurements do not prove that a route honors cache-control fields. Check its declared capabilities before requesting controls; do not assume a cache hit or discount before settlement.
Choose compatible cache controls
Check a model’s provider capabilities with GET /v1/models/MODEL_ID. Undeclared support means explicit controls are rejected. In API discovery, providers[].prompt_caching is null when undeclared; an empty list declares no controls. Each entry applies to one endpoint. Prices and capability declarations are separate.
cache_controlusestype: "ephemeral"and a five-minute default orttl: "1h". Root hints work only on routes declaring request support. Chat/Messages can also declare text and tool markers. At most four markers apply in total; one-hour prefixes must come before five-minute prefixes.- Chat/Responses can instead declare
prompt_cache_optionswith implicit/explicit mode and a 30-minute TTL, orprompt_cache_retentionwithin_memoryor24h. Use one family at a time. Explicit content markers useprompt_cache_breakpoint: { "mode": "explicit" }on Chat text or Responses input-text blocks, within the route’s limit. prompt_cache_keystays on individual Chat/Responses requests. DeepXRoute scopes it to the account, API key, endpoint, destination and supplier credential version before forwarding. It is also used for session routing when no explicit session ID is supplied. This routing preference begins after a measured cache read; it does not guarantee a hit.
Invoices & receipts API
Sync issued invoices, payment receipts and credit notes into your accounting tools. In Server automation keys, choose Read invoices, receipts and credit notes. For an accounting-only credential, leave the other permissions at no access. Team owners and administrators create these credentials.
This grants access to buyer details, payment references and PDFs for the selected account. Ordinary API keys, including those with wallet or usage access, cannot read documents. Keep the management credential on your server.
Find a document
curl --fail-with-body --get 'https://api.deepxroute.com/v1/billing/documents' \
-H "Authorization: Bearer $DEEPXROUTE_MANAGEMENT_KEY" \
--data-urlencode 'kind=invoice' \
--data-urlencode 'limit=25'Use invoice, receipt or credit_note; omit kind for all documents. Filter one purchase with orderId. When hasMore is true, pass nextCursor as cursor, keeping the account and filters unchanged. Start a fresh list to find newly issued documents.
Read details or download the PDF
# Replace DOCUMENT_ID with an id from items.
curl --fail-with-body 'https://api.deepxroute.com/v1/billing/documents/DOCUMENT_ID' \
-H "Authorization: Bearer $DEEPXROUTE_MANAGEMENT_KEY"
curl --fail --output document.pdf \
'https://api.deepxroute.com/v1/billing/documents/DOCUMENT_ID/pdf' \
-H "Authorization: Bearer $DEEPXROUTE_MANAGEMENT_KEY"amount_usd is an integer string in nanoUSD: 1 USD = 1,000,000,000 units. amount_cents is in the document’s currency, which is USD cents. Only documents from the retired Curlec trial show MYR sen and keep their original exchange-rate snapshot.
Corrected invoices link to the original through supersedes_id; an older invoice exposes replaced_by_id. Preserve both for your audit trail and avoid counting a correction as another purchase. Refund credit notes are separate documents.
Connect n8n
Start with n8n’s built-in HTTP Request node. These workflows need no DeepXRoute community package and make no paid generation requests. Importing a workflow does not execute it.
Read your available models
- Download model discovery workflow and choose Import from File in n8n’s workflow menu.
- Create an inference API key in the intended workspace. In List available models, create a Header Auth credential with Name
Authorizationand ValueBearer YOUR_API_KEY. Replace the placeholder with your key, retaining the space after Bearer. Save it only in the credential, not the workflow fields. - Review the URL, then execute the workflow manually. The example targets
https://api.deepxroute.com/v1/models. Inspect permitted models and their availability before generating anything. An empty catalogue means no models are available to this key.
Set Authentication → Generic Credential Type → Header Auth if you add your own HTTP Request node. Keep the configured HTTPS origin and disable redirects. The imported examples already do this. Your n8n host may charge for workflow executions.
Connect ComfyUI
Discover hosted image and video models, submit a job and bring private outputs into your ComfyUI graph as native IMAGE, MASK or VIDEO values.
Source install only; not listed in Comfy Registry or Manager. You need an authorized DeepXRoute checkout and a private ComfyUI server you control. Without source access, use the image and video API.
- Copy
integrations/comfyuifrom the checkout to your ComfyUI installation’scustom_nodes/deepxroutefolder. Install itsrequirements.txtwith the same Python environment that runs ComfyUI. Preserve any existing installation before replacing it. - Supply
DEEPXROUTE_API_KEYthrough the ComfyUI server’s environment, using an inference key with model and spending limits. The default API origin ishttps://api.deepxroute.com. Restart the server. Never enter the key into a graph or prompt: everyone who can run graphs on that server can use its configured credential. - Open
workflows/01-discover-models.jsonfrom the copied directory and run it. Discovery has no generation charge. Inspect the available model IDs, capabilities and output prices before choosing paid work.
Set up a team
- Open Teams, create a team and choose its payment region. The team starts with a separate USD wallet.
- Invite members with a role and optional USD spending and model limits. Share each expiring, single-use link privately. The recipient signs in and explicitly accepts; no email is sent.
- Choose the team in the workspace account selector before creating keys, adding credit or using models. Each tab keeps its own selection. Switching accounts reloads the workspace and clears unsaved drafts and one-time secrets.
- Create a team API key and use the same API endpoint and client examples above. The key carries its team identity; do not add an account-selection header to public API calls.
Owners and administrators manage shared supplier credentials. Developers manage their own keys and private outputs. Finance members manage the team’s billing and review team usage. Viewers see membership and their own historical usage.
Team and member limits count settled charges and all outstanding holds. Daily, weekly and monthly periods reset in UTC; weeks start Monday. These limits cover DeepXRoute wallet charges, while supplier-direct bills remain separate.
Restrict supplier access
In Teams, open Team settings to set the supplier list for everyone. Open a member’s Manage form, or an invitation, to set a narrower list. Choose all/inherited access, selected supplier IDs, or no suppliers. Confirm changes with your current password.
The team and member lists intersect. An empty list blocks dispatch; inherited access adds no restriction. Limits apply to API keys and console requests, platform routes, saved supplier keys and every fallback attempt. Request options cannot override them. Supplier IDs identify DeepXRoute routes, such as the platform route ID shown in a model’s provider details; they do not identify or restrict the model providers behind a route. Find configured route IDs in the model’s provider details.
Images and videos currently use the platform route. A job denied before submission fails and releases its hold. A text or media attempt already sent may finish and be charged. Removing supplier access does not delete historical usage, invoices or receipts. Privacy, retention and region guarantees need separate verified supplier policies.
Changing a member’s role or removing them revokes their existing inference and management credentials and unused invitations. Rejoining preserves prior usage and does not restore old keys. Owners must transfer ownership before leaving.
In the selected team’s Billing page, owners, administrators and finance members can update the buyer profile and download invoices, receipts, credit notes and transaction statements. Personal sign-in and optional MFA remain under Settings.
Transfer existing credit
Select the team, then open Billing · Transfer credit. Owners, administrators and finance members can move their own personal credit into the team. Only the owner can return team credit to their own personal account. Choose the direction and USD amount, review both accounts, then confirm with your current password. Held credit cannot move. This is an internal transfer, so no new payment or currency conversion is made.
If the result is uncertain, keep the saved reference. Check its status, retry the same transfer, or cancel that reference before starting another. Reloading this tab preserves recovery details; passwords are never saved. A cancellation that finds an already completed transfer shows its result.
Refunds can reclaim the original payment’s unspent credit wherever it moved. The purchaser remains responsible for any already-consumed portion, and disputes can pause affected accounts. Original invoices, receipts and credit notes stay with the purchaser. Transfers appear in transfer history and wallet statements. Nested project workspaces are not available yet.
Close a team and retain its records
Only the owner can close a team. In Teams, choose Review team closure. Finish active work, resolve held credit and settle any team debt first. Review the current balance, type the exact team name, accept ongoing refund and dispute responsibility, then confirm with your password. Closure is permanent.
The remaining USD balance returns to the closing owner’s personal wallet. All members lose access, credentials are revoked and supplier secrets are erased. An unpaid checkout may still complete; late captured credit also returns to the closing owner. Refunds reclaim unspent credit, and any already-consumed portion of the team’s purchases can leave the owner’s personal wallet in deficit.
If a response is lost, check closure status or retry the saved reference. No result yet does not cancel a pending closure. After closure, the owner can select the closed team to download its original invoices, receipts, credit notes and statements, review usage and request a buyer correction. Closed teams do not count toward the one-active-owned-team limit.
Choose your provider
Look up a model with GET /v1/models/MODEL_ID (example below) to see its configured providers and their prices. Choose one provider to keep the request there, or allow eligible providers with an optional first choice. A model with only one provider has no backup. Platform prices can differ by provider. Compare the route’s USD rates before copying your request; BYOK fees use the default model price.
# Check current provider IDs and capabilities first.
curl --fail-with-body https://api.deepxroute.com/v1/models/qwen3.8-max \
-H "Authorization: Bearer $DEEPXROUTE_API_KEY"
# Restrict to one route ID from the lookup above; no automatic fallback.
curl --fail-with-body https://api.deepxroute.com/v1/chat/completions \
-H "Authorization: Bearer $DEEPXROUTE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.8-max",
"messages": [{ "role": "user", "content": "Hello" }],
"max_completion_tokens": 256,
"provider": { "only": ["<route id>"], "allow_fallbacks": false }
}'Use IDs returned by the model lookup; provider availability may change. Preview pricing still needs activation, and your key’s model permissions, budget, expiry and wallet balance still apply. The same provider controls work with Chat Completions, Responses and Messages.
For related conversation turns, session routing can prefer the same eligible provider. An explicit provider order or sorting choice takes priority over that preference.
onlyandignore- Allow or exclude provider IDs. Restrictions apply to every attempt; an empty
onlylist permits none. order- Try eligible providers in this order, followed by other eligible providers. Use
onlyas well to restrict the complete list. With a performance target, this order applies within each health and target group. allow_fallbacks- Defaults to true. False limits the request to the first eligible provider. A fallback needs another compatible provider and a confirmed non-billable rejection.
require_parameters- True excludes providers without declared parameter capabilities and rejects unsupported request fields. Check
supported_parametersin the model response; null means strict matching is unavailable. max_price- Optional
promptandcompletionceilings, in customer USD per million tokens. For example, 0.60 means $0.60 per million input tokens. These are price ceilings, not total spending limits; use an API-key budget to limit spending.
Python’s OpenAI SDK accepts routing through extra_body={"provider": …}. Disable SDK retries: resubmitting a text POST creates a separate request.
What happens when a provider fails?
Fallback uses one wallet reservation and can try another provider only after a rejection confirmed as non-billable. It never replays a timeout, a server error, an interrupted response or an accepted stream. Uncertain usage keeps credit held for review; check Usage before sending a new request.
Keep x-request-id for support. x-dxr-provider and x-dxr-attempts identify the last responding provider and attempt count. Response headers alone do not confirm completed usage. Unknown providers, incompatible settings and unsupported policies return 400 before credit is reserved.
Supplier keys (BYOK) let you choose customer-owned credentials where configured. Their separate routing fee and saved fallback permission also apply.
Response caching is an optional, separate control for reusing completed output without another supplier call.
Track related requests with sessions
Give related text, image and video requests the same session ID to group their usage within your account, across API keys, models and interfaces. Reporting works independently of discounted cache pricing. A session does not store conversation content or send earlier messages for you.
Add a session ID to your request as in the example below. Your code should reuse one opaque ID for the conversation and send the conversation content on each request.
curl --fail-with-body -i https://api.deepxroute.com/v1/chat/completions \
-H "Authorization: Bearer $DEEPXROUTE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "qwen3.8-max",
"session_id": "conversation-123",
"messages": [{ "role": "user", "content": "Hello" }],
"max_completion_tokens": 256
}'You can send x-session-id: conversation-123 as a header instead. The body value takes precedence; both values must be valid if supplied. Use a nonempty ID of at most 256 characters without control characters. Choose a new ID for a new conversation or workflow.
Find a session in Usage
Text responses return x-dxr-session-ref, including streams. Media submissions also return session_ref in the JSON body; subsequent job reads retain it. DeepXRoute uses this opaque reference for reporting and does not store or forward your original ID.
Open Usage and choose “By session”, “By day and session” or “By model and session”. Expand a row’s session reference to copy it, or choose “View requests” to drill down. Under “Filter by session”, paste the 64-character reference—not your original session ID—and apply filters. CSV exports use those same applied filters. “Without a session” includes historical requests and requests without an explicit ID. Date and member access limits still apply.
Provider affinity for text requests
For text models with a discounted cache-read price, the ID also helps prefer the same eligible provider, with normal fallback. This routing preference is separate for each API key, model and API interface. Media sessions only group reporting; they do not change routing.
Inspect x-dxr-provider to see who served the request. A session ID does not guarantee a cache hit, a discount or a free response. Each generation can incur charges; pricing activation and wallet credit still apply. Check measured cache usage and charges after settlement. Response reuse is a separate opt-in feature.
Reuse a completed response
Response caching can reuse an identical request from the same API key without another supplier call or charge. It works with Chat Completions, Responses and Messages, including streaming. It is off by default.
curl https://api.deepxroute.com/v1/chat/completions \
-H "Authorization: Bearer $DEEPXROUTE_API_KEY" \
-H 'Content-Type: application/json' \
-H 'x-dxr-cache: true' \
-H 'x-dxr-cache-ttl: 300' \
-d '{"model":"qwen3.8-max","messages":[{"role":"user","content":"Explain HTTP caching."}],"max_tokens":256}'A hit returns x-dxr-cache-status: HIT, a new request ID, zero token usage and a zero USD charge. x-dxr-cache-source-id identifies the original request. A MISS runs normal inference and may incur a charge; it does not guarantee the result will be stored. Pricing activation, access controls and rate limits still apply.
- Lifetime: set
x-dxr-cache-ttlto 1–86,400 whole seconds; the default is 300. A changed lifetime applies to new fills, not an existing entry. - Bypass: send
x-dxr-cache: falseto generate a new response without reading or storing a cached result. - Refresh: send
x-dxr-cache-clear: truewith caching enabled to discard the matching entry and make a new, potentially billable request.
In Usage, filter “Response cache” to find free hits and inspect their source references. The reporting APIs and CSV exports include cache_status and cache_source_id; use cacheStatus=hit to select hits. BYOK hits also have no new routing fee or supplier charge.
Use your own supplier keys
Bring your own key (BYOK) connects a supplier account you pay directly. Your apps still authenticate with a DeepXRoute API key; the supplier secret stays in your account’s encrypted storage.
- Open Supplier keys in API keys. Choose an available supplier, paste its key and set a descriptive label. If no supplier is configured, adding a key is unavailable.
- Choose primary or backup key order, priority, optional model and application API key limits, and expiry. Keep the default platform-credit block unless you want to permit full-price DeepXRoute capacity.
- Choose your account default. Automatic follows your saved key order. Supplier keys only stops when none can serve the request. Platform only uses ordinary DeepXRoute credit. Claude Code and Codex use this default without changing their configuration.
- Check the model’s price on the public models page, then make a request. Saving a key does not verify supplier access, activate pricing or add credit.
Choose primary and backup keys
Automatic mode uses this order, stopping as soon as a request succeeds:
- Primary supplier keys.
- Platform routes that satisfy every applicable saved spending policy.
- Backup supplier keys.
Within each supplier-key group, your provider order comes first, then lower key priority numbers. Supplier keys only skips the platform step; Platform only skips both supplier-key groups. Choosing Backup does not permit platform spending. Without that permission, backup keys follow primary keys directly.
All three steps share the eight-attempt limit. With allow_fallbacks: false, only the first eligible attempt runs; that may be a platform route if you only have backup keys and permit platform credit. An uncertain response stops the sequence for review.
Control where platform credit can be spent
Each key has a Platform credit in Automatic setting. Matching models means its model selection, or all models when unrestricted. Every choice respects its application API key limit.
- Block all suppliers · matching models. The default keeps matching requests on saved supplier keys across all suppliers. Existing no-platform-credit settings keep this rule.
- Block this supplier · matching models. Matching models must use your key on this supplier. Other models and other suppliers may use full-price platform credit.
- Block this supplier · all models. This supplier cannot use platform credit, even outside the key’s model selection. Other suppliers may still use full-price platform credit.
- Allow platform credit. This key adds no restriction to platform spending. Other saved keys can still block it.
Restrictions combine: an Allow setting cannot override another key’s block. To require your own keys everywhere, choose Supplier keys only. To restrict suppliers as well, use provider.only. A supplier-wide spending block never expands the models your key can use.
Separate applications with API key limits
Limit a supplier key to selected DeepXRoute API keys to keep applications or environments separate. Select keys by their labels and prefixes, never by pasting another secret. Both the model and API key limits must match. Without an API key limit, all current and future application keys and the console playground can use it.
Unselected applications and the playground skip a restricted supplier key and its fallback preference. In Automatic mode they may use platform credit. Choose Supplier keys only to stop when no matching supplier key is available. Revoking an application key does not transfer its access to a replacement; edit the supplier key to select the replacement explicitly.
Choose credentials for one request
An explicit choice overrides the account default. Send byok to require a saved supplier key or platform to use DeepXRoute capacity. Omit the field, or use auto, to follow your account default. Do not put a supplier secret or URL in the request body.
curl https://api.deepxroute.com/v1/chat/completions \
-H "Authorization: Bearer $DEEPXROUTE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.8-max",
"provider": { "credentials": "byok", "allow_fallbacks": false },
"messages": [{ "role": "user", "content": "Hello" }],
"max_completion_tokens": 64
}'Use an enabled model returned by the catalog. The same credential controls work with Chat Completions, Responses and Messages. The example makes at most one supplier attempt; a successful key check alone does not guarantee that inference is available.
Understand the two bills
Your supplier charges its own usage to your supplier account. DeepXRoute charges a separate fee based on its listed model token prices and the configured fee percentage. For illustration, a 5% fee on $1.00 of listed usage is $0.05, plus whatever your supplier charges. Check the current fee rather than relying on this example.
A supplier-key-only request reserves the maximum DeepXRoute fee, then settles the fee for reported usage. If platform fallback is permitted, the reservation covers the full model price. A successful supplier-key request still settles only its fee; a platform attempt settles the full model price. Key budgets limit DeepXRoute charges and holds, not your separate supplier bill.
Usage labels BYOK fees and separates them from platform charges. CSV exports include the fee version and credential reference. Supplier invoices come from the supplier; DeepXRoute receipts and invoices cover your prepaid credit purchases in Billing.
Fallback and recovery
- Automatic checks each platform route against the saved spending policies. Disabled and expired keys keep their policies. When a supplier has no unrevoked applicable key, its last applicable revoked policy remains. Removing or excluding a supplier does not erase its policy.
- To return to normal platform usage after revoking a key, explicitly select Platform only as your account default or in the request. API key limits always scope a policy to the selected apps; a supplier-wide block also covers models outside the key’s model selection.
- At most eight attempts share one reservation. Fallback only follows a confirmed, configured non-billable rejection. Timeouts, incomplete streams and uncertain responses keep credit held for review. Do not enable automatic SDK retries.
- Replacing a key preserves its policy. After a lost response, reload the list and check the secret version before trying again. Revocation erases the saved secret; already authorized calls may finish using it.
- Retain the request ID,
x-dxr-provider,x-dxr-attemptsandx-dxr-billing-modewhen contacting support. Never include either key’s secret.
Provider routing controls explain provider restrictions, optional parameters and catalog-price ceilings.
Automate key management
Create a separate management credential for a backend service or CI job. Choose inference-key permissions for application access and usage, and supplier-key permissions for BYOK. Read-only access is enough for inventory. Management credentials cannot run models, make payments or change sign-in settings.
Store the credential in your server’s secret manager as DEEPXROUTE_MANAGEMENT_KEY. It must use the Bearer header. Ordinary inference keys and the alternative x-api-key header do not authorize management requests.
Manage inference keys
# Read permission: list keys, including revoked/expired records.
curl 'https://api.deepxroute.com/v1/keys?page=1' \
-H "Authorization: Bearer $DEEPXROUTE_MANAGEMENT_KEY"
# Read/write permission: create a key with a $10 monthly limit.
# Generate a UUID once and replace YOUR_SAVED_UUID; retain it for retries.
curl https://api.deepxroute.com/v1/keys \
-H "Authorization: Bearer $DEEPXROUTE_MANAGEMENT_KEY" \
-H "Content-Type: application/json" \
-d '{
"requestId": "YOUR_SAVED_UUID",
"name": "Production app",
"budgetNanoUsd": "10000000000",
"budgetPeriod": "monthly",
"allowedModels": ["qwen3.8-max"],
"billingRead": false
}'Save the returned key in the application’s secret manager. After a timeout, retry the same creation UUID and settings with the same management credential to recover the same key. Changing settings under the same UUID returns a conflict. List/get responses never include secrets. A new UUID creates a separate key.
# Read current metadata and revision first.
GET /v1/keys/KEY_ID
# Keep omitted settings; send the latest revision to avoid stale writes.
PATCH /v1/keys/KEY_ID
{"revision":1,"budgetNanoUsd":"5000000000"}
# Revoke model access; usage history remains available.
DELETE /v1/keys/KEY_IDLimits are integer nanoUSD: 1 USD = 1,000,000,000 nanoUSD. A null budget means no key limit; zero prevents new spending. Set budgetPeriod to daily, weekly, monthly or lifetime. Resets use 00:00 UTC: every day, Monday, or the first day of the month. Lifetime limits never reset. Unfinished work stays held across resets; final costs count when work completes. Budgets count prepaid credit only: requests covered by a monthly plan are limited by the plan’s own limits instead. Every inference key shares the account wallet. Creating keys does not add credit or activate provisional models. Two hundred unrevoked inference keys and five active management credentials are allowed per account.
Rotate credentials by creating and testing a replacement, updating your automation, then revoking the old credential. Revoking a management credential does not revoke the inference or supplier keys it managed. Revoke those separately when needed; previously accepted requests can still finish and settle.
Manage supplier keys and routing
Supplier permissions start off. Choose read access to inspect saved keys, configured suppliers and routing defaults. Choose read/write to add, replace or revoke supplier keys, change their model and application limits, and control platform fallback. This also permits changing the account default to full-price platform billing. Existing management credentials do not gain these permissions automatically.
Store your supplier secret in your automation’s secret manager. The API accepts it when saving or replacing a key, then returns metadata only. Read the configured supplier IDs first; a successful save does not confirm that the supplier accepts the key. See the supplier-key guide for fees, application limits and fallback behavior.
# Supplier read permission: configured suppliers, fee and account default.
curl https://api.deepxroute.com/v1/provider-keys/settings \
-H "Authorization: Bearer $DEEPXROUTE_MANAGEMENT_KEY"
# Supplier write permission: save a key without platform fallback.
# Replace placeholders in server automation; retain the UUID for retries.
curl https://api.deepxroute.com/v1/provider-keys \
-H "Authorization: Bearer $DEEPXROUTE_MANAGEMENT_KEY" \
-H "Content-Type: application/json" \
-d '{
"requestId": "YOUR_SAVED_UUID",
"provider": "YOUR_PROVIDER_ID",
"name": "Production supplier",
"secret": "YOUR_SUPPLIER_KEY",
"allowPlatformFallback": false
}'Keep this creation UUID and the exact settings after a timeout. Unlike inference-key creation, supplier-key retry identity is shared across your account, so replacing the management credential does not create another supplier key. Identical retries return metadata while the original key is unchanged. Changed settings, any edit or revocation cause a conflict; read the saved record before deciding what to do.
# Supplier read permission: includes current revision and secret_version.
GET /v1/provider-keys/PROVIDER_KEY_ID
# Supplier write permission: restrict to an existing application API key.
PATCH /v1/provider-keys/PROVIDER_KEY_ID
{"revision":1,"allowedApiKeys":["APPLICATION_KEY_UUID"]}
# Replace the secret; preserve its model/app limits and fallback setting.
POST /v1/provider-keys/PROVIDER_KEY_ID/rotate
{"revision":2,"secret":"YOUR_REPLACEMENT_SUPPLIER_KEY"}
# Erase the stored secret; preserve policy and usage history.
DELETE /v1/provider-keys/PROVIDER_KEY_IDUse the latest revision for each update or replacement. Omitted fields stay unchanged; null removes a model or application limit. After an interrupted replacement, read the revision and secret version before retrying. Revoking a supplier key does not grant platform fallback, and calls already authorized may finish. Read-only automation cannot change keys or routing preferences.
Management requests are limited to 60 per minute per account. The OpenAPI document includes schemas, pagination, permissions and error responses.
Secure your API keys
Open Key security in your console. Check the selected personal or team account before reviewing keys or changing its policy. Owners and administrators manage the account; developers manage their own inference keys. Finance and viewer roles cannot access credentials.
- Review access. Filter inference or management keys by name, prefix, owner, state or review category. Missing limits and expiry are review prompts, not proof of misuse. Unknown activity means historical authentication evidence is incomplete. Export the filtered CSV for a complete review; it includes up to 10,000 matching keys and never includes secrets.
- Apply a bounded change. Select the keys you intend to change, review their names and prefixes, then confirm your password. Selection clears when pages or filters change. Disable is reversible; revoke is permanent. Setting missing limits affects inference keys only and preserves existing limits. An enabled authenticator must be verified; MFA remains optional.
- Restrict API access when ready. Under Account policy, add your application servers’ fixed public egress IPs or CIDR ranges, including IPv6 if used. The observed console connection may be your laptop’s address, not your server’s. Check the egress address with your hosting/network configuration. Dynamic CI runners may need fixed egress before using an allowlist. Do not allow a whole public network or a shared CDN address to make a failed request pass.
Expiry and network rules
A maximum lifetime of 1–366 days applies from the key’s original creation to its explicit expiry. Existing keys with no expiry or an excessive lifetime are denied while the limit is enabled; settings do not silently rewrite their expiry. Update expiry in API keys, or replace a credential that cannot meet the policy.
Network rules apply to existing and new inference and management keys on all public API routes. Test from the actual application server after saving. Unsent or queued work may be canceled when its source becomes disallowed or is unknown; already dispatched work still settles once. A 401 can indicate a disabled, revoked or expired key. A 403 can indicate network, lifetime or other access restrictions; review the returned error before retrying.
Recover without losing console access
API network and lifetime restrictions do not restrict console sign-in. If a server is blocked, sign in, select the correct account and open Account policy. Correct the rules, or clear the network list and save to remove that restriction. Leave maximum lifetime blank and save to remove the account lifetime limit. Other credential and spending restrictions remain in effect.
If a save is interrupted, keep the page open and choose “Retry same change” or “Retry same policy change”. The console retains the same operation reference and values in memory so recovery does not apply a second change. Do not refresh or close an unconfirmed change. After a revision conflict, load the latest policy for comparison, then replace the draft and reapply the changes you still want. Never paste passwords or keys into a support message.
Reusable guardrails
Open Guardrails in Key security for the selected personal or team account. Owners and administrators manage policies and assignments.
- Create a policy. Name it, choose a USD limit and reset period, then restrict models, providers or privacy if needed. Creating a policy does not assign it. “No added restriction” leaves other policies in force; “Block all” denies every entry.
- Assign it deliberately. Select a named key or team member, or Account default · all keys, and review the current assignment. Each subject can have one direct guardrail. The account default covers every existing and future key and console request. A member’s policy covers all their keys, including future keys and console usage. A key’s own policy adds restrictions to that baseline.
- Check effective access. Choose a key to see combined model/provider restrictions, its privacy minimum, and exact spent/held amounts for assigned and direct limits. Refresh before relying on the snapshot. Supplier capability, current privacy reviews, credit and key status are checked again when a request is made.
Spending and privacy
Member and key assignments give each subject a separate allowance. An account default has one shared allowance across the account, including historical unkeyed usage. Member usage spans all their keys; key budgets stay independent. Daily, weekly and monthly periods reset at 00:00 UTC, on Monday for weeks and the first day for months. Lifetime never resets. Earlier spending and all unfinished holds count, so changing an assignment cannot reset its allowance.
Privacy requirements can only strengthen account settings. No-collection and zero-retention policies block unreviewed text routes and all current media routes. Zero retention also disables response caching and rejects explicit supplier cache controls. Queued media that becomes disallowed fails before submission and releases held credit. Already dispatched work can still finish and settle.
Privacy by model author
Use Additional rules by model author in account privacy or a guardrail to require stronger protection for Anthropic, OpenAI, Google, xAI or other model families. The strictest global and matching group rule across the account, member and key applies. Other model authors is an explicit classification; an unclassified model uses the strictest configured group rule.
The Models screen shows the operator-declared author group and evaluates each fallback separately. Supplier names do not determine authorship. Rules apply to platform and saved-key routes; zero-retention responses cannot fill or reuse the response cache. Unrestricted fallback models can still use it.
For API changes, send privacyGroups: { "openai": "zdr", "google": "deny" } when creating or editing a guardrail. Omit the field to preserve saved group rules on an edit; send {} to remove the additional rules. The global minimum and other assigned policies still apply.
Filter sensitive input
Expand Content filters when editing a guardrail. Choose Off, Redact or Block request for email addresses, phone-like numbers, Malaysian NRIC, US Social Security numbers, payment cards, IP addresses and API keys. Add a custom RE2 pattern for project-specific text. Preview with synthetic text before saving and assigning the policy; preview only checks that draft.
Account, member and key filters combine. Every rule checks the original input and a blocking match wins. Redaction replaces text with a label such as [EMAIL]. Text requests, tool arguments and media prompts are checked before dispatch; media prompts are also filtered before storage and checked again when queued work starts. Matching protocol identifiers, object keys or numeric values blocks rather than changing their meaning. Blocked submissions have no inference charge.
These are format detectors, not a guarantee of finding every secret. Phone matches are broad; card numbers use a checksum and NRIC matches check format only. API key detection covers recognized credential formats, including test keys, without validating them. Generic passwords and unprefixed hashes are not detected; 0x-prefixed 64-digit hexadecimal values can also be transaction hashes. Names, addresses, image content, arbitrary encoded data, model responses and prompt injection are not analyzed. JSON tool arguments are decoded before checking. Keep other privacy controls in place.
Send contentFilters: [{ "kind": "email", "action": "redact" }] when creating or editing a guardrail. Omit the field on an edit to preserve it, or send [] to clear this policy’s filters. POST /v1/guardrails/preview accepts filters and text with a guardrails:read credential. Up to 20 filters per policy, 32,000 preview characters and 20 previews per minute per account are supported. Previews are not saved and do not call a model or spend credit.
Recover a change
Confirm your current password when saving. If the result is unconfirmed, keep the page open and choose Retry same guardrail change; the frozen operation is reused. For a stale-policy conflict, discard the draft and reload before editing again. Remove all assignments before archiving a policy. Archived policies can be restored without creating another identity.
Automate guardrails
Create a management credential with guardrails:read for discovery and, when needed, guardrails:write for changes. Select the intended personal or team account before creating it. Existing credentials gain no new permission. Read access includes subject identities; write access can change restrictions across the account.
Set BASE_URL=https://api.deepxroute.com and keep MANAGEMENT_KEY in your private environment. List policies before changing them:
curl --fail-with-body "$BASE_URL/v1/guardrails" \
-H "Authorization: Bearer $MANAGEMENT_KEY"To create a policy, generate and save one UUID as REQUEST_ID. This example adds a $20 daily limit but assigns nobody. After an uncertain result, repeat the same request ID, body and credential; never generate a new ID merely to retry.
curl --fail-with-body "$BASE_URL/v1/guardrails" \
-H "Authorization: Bearer $MANAGEMENT_KEY" \
-H "Content-Type: application/json" \
-d '{"requestId":"'"$REQUEST_ID"'","name":"Application daily limit","allowedModels":null,"allowedProviders":null,"privacyMode":"none","budgetNanoUsd":"20000000000","budgetPeriod":"daily"}'Discover subjects with GET /v1/guardrails/targets?targetKind=key or targetKind=member, or use targetKind=account to discover the selected account’s ID. Lists use 25 records per page and return hasMore; increment page to continue. Retired subjects remain listed for removal. No secret keys are returned.
Send POST /v1/guardrails/assignments with a new request ID, the current list revision, guardrailId, and 1–100 unique targets containing targetKind and targetId. A batch commits together or changes nothing. Use a null guardrail ID to remove direct assignments. Read GET /v1/guardrails/effective?keyId=UUID to inspect combined restrictions and spending afterward.
Edit, archive or restore with PATCH /v1/guardrails/UUID, supplying every policy field, its current revision and archived. Remove assignments before archive. A stale revision returns 409: reload and review before starting a new operation. An exact retry returns the original receipt, so reload for current state. See the OpenAPI document for complete request and response schemas. These operations never run a model or charge for inference.
Guardrails do not erase retained content or billing history, and a setting is not proof of a supplier’s privacy practices. Pattern-based content filtering has the limits described above; geographic residency guarantees are not included.
Service status
Operator-reported incidents and updates. No reported incident does not verify availability of every model, provider or payment method. This page shares the console infrastructure; it is not an independent uptime monitor.
Checking published reports…
Resolved incidents
Loading incident history…
Published history is retained. Corrections appear as later updates. For integration errors, keep your request or job reference and check its result before repeating a paid request.