Skip to content

API Reference Overview

The DeepIntShield gateway exposes documented routes compatible with selected OpenAI, Anthropic, and Google Gemini wire formats. Point a supported client at the matching route and supply a Virtual Key. Guardrails, caching, routing, and logging apply only when enabled, entitled, and supported for that route. For a compatible endpoint, migration usually needs a base-URL and credential change; verify route-specific parameters, streams, tools, uploads, batches, headers, and error shapes before migration.

For Python applications, the deepintshield SDK adds typed provider builders, explicit guardrail and RAG evaluation, MCP adapters, Agentic enforcement, and a centralized error-code catalog.

Point your client at the hosted DeepIntShield cloud gateway:

https://app.deepintshield.com

If you run an Enterprise VPC or self-hosted data plane, replace the host with the ingress for your data-plane gateway (for example https://<your-deepintshield-host>). Exact enabled routes depend on the deployed release and configuration. See Setting up the gateway.

Inference requests are authenticated with a virtual key. Create and manage keys from the Web UI - see Virtual Keys.

The gateway accepts the virtual key in any of the following headers, so you can keep using whichever header your existing client already sends:

HeaderTypical client
x-deepintshield-vk: sk-ds-your-virtual-keyDeepIntShield-native clients
Authorization: Bearer sk-ds-your-virtual-keyOpenAI SDKs and most HTTP clients
x-api-key: sk-ds-your-virtual-keyAnthropic SDK
x-goog-api-key: sk-ds-your-virtual-keyGoogle Gemini SDK
Terminal window
curl -X POST https://app.deepintshield.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DEEPINTSHIELD_VIRTUAL_KEY" \
-d '{
"model": "openai/gpt-4o-mini",
"messages": [{"role": "user", "content": "Hello, DeepIntShield!"}]
}'

These routes use the unified OpenAI-style request/response shape. The gateway translates when the selected provider supports the corresponding request type; not every provider implements every endpoint or parameter. Send them to the gateway base URL.

MethodPathPurpose
POST/v1/chat/completionsChat completions (streaming and non-streaming)
POST/v1/responsesOpenAI Responses API
POST/v1/responses/compactCompact a Responses conversation
GET, DELETE/v1/responses/{response_id}Retrieve, stream retrieval, or delete a stored response
POST/v1/responses/{response_id}/cancelCancel a stored response
GET/v1/responses/{response_id}/input_itemsList input items when the provider supports it
POST/v1/completionsLegacy text completions
POST/v1/embeddingsEmbeddings
POST/v1/rerankReranking
POST/v1/audio/speechText-to-speech
POST/v1/audio/transcriptionsSpeech-to-text
POST/v1/images/generationsImage generation
GET/v1/modelsList available models
GET/healthGateway health check (no auth)

Streaming responses follow the standard OpenAI Server-Sent Events format - set "stream": true in the request body. See Streaming. Stored Responses availability differs by provider; see the exact lifecycle matrix.

These routes retain their provider-native resource semantics. Model-less operations require a provider selector and, when more than one key is eligible, the same explicit configured-key selector used to create the resource.

MethodPathPurpose
POST, GET/v1/cached_contentsCreate or list named Gemini or Vertex cached content
GET, PATCH, DELETE/v1/cached_contents/{cached_content_name}Inspect metadata, update expiry, or delete cached content
POST/v1/ocrRun Mistral OCR
GET/v1/realtimeUpgrade to a Realtime WebSocket frame relay
POST/v1/realtime/client_secretsCreate an ephemeral Realtime client secret
POST/v1/realtime/sessionsPass through WebRTC SDP/session negotiation
POST/v1/realtime/transcription_sessionsNegotiate realtime transcription
POST/v1/realtime/translations/client_secretsCreate a translation client secret
POST/v1/realtime/callsProxy provider-native call creation
POST/v1/realtime/calls/{call_id}/{action}Proxy accept, hangup, refer, or reject

Gemini-compatible cached-content routes are also exposed as /v1beta/cachedContents. Realtime call control is a provider-native proxy, not SIP or full telephony orchestration. See Protocol operations for request formats, provider coverage, key affinity, and transport limits.

When durable webhooks are enabled with a SQL store, management routes under /api/webhooks create and disable subscriptions, enqueue idempotent events, inspect deliveries, and replay any delivery that is not currently in progress. They use management authorization rather than an inference virtual key. See Durable webhooks and object storage for the canonical route table and deployment constraints.

Delegated MCP authentication remains part of inference/tool execution rather than a separate public route family. Callers provide X-MCP-Subject-Token only for a configured OAuth-enabled Streamable HTTP client. See Delegated MCP authentication for isolation, pool, and protocol boundaries.

The current gateway exposes asynchronous submit and poll routes for the following request types. Submission returns a job ID; polling uses the same path plus /{job_id}.

Submit path
/v1/async/completions
/v1/async/chat/completions
/v1/async/responses
/v1/async/embeddings
/v1/async/rerank
/v1/async/audio/speech
/v1/async/audio/transcriptions
/v1/async/images/generations
/v1/async/images/edits
/v1/async/images/variations

Async Responses rejects stream=true. See Async inference for submission and polling examples.

If you prefer to keep your client speaking a provider’s exact dialect, send requests to the matching compatibility prefix. The gateway converts the documented shapes and applies features supported on that route.

Prefix every OpenAI path with /openai:

POST /openai/v1/chat/completions
POST /openai/v1/responses
POST /openai/v1/embeddings
GET /openai/v1/models

See the OpenAI integration.

Raw provider passthrough is a separate route family and can have different policy/cache behavior. See Passthrough integrations and browse the compatibility guides under Integrations.

Errors are returned with standard HTTP status codes and a JSON body. Do not use HTTP status alone as the application branch: parse the stable code when the body supplies one and retain the request/decision identifier for operations. Common status classes include:

StatusMeaning
401Missing or invalid virtual key
403Request blocked by a guardrail or governance policy
429Rate limit or budget exceeded
5xxUpstream provider or gateway error

Provider-native clients raise their own HTTP exception types. Direct DeepintShield.request(), RAG, guardrail, and MCP calls raise DeepintShieldError with normalized code, trusted description, retryable, details, status_code, and raw message/payload fields. Review details before display or logging, and keep raw gateway data in protected diagnostics. See SDK error codes for the catalog, retry rules, and forward-compatibility contract.

Use protocol operations

Manage stored Responses, cached content, realtime sessions, and OCR.

Protocol operations →