Skip to main content
Create a model response with POST /openai/{region}/v1/responses. Langdock implements the OpenAI Responses request and response shape for the fields listed below, so you can use the OpenAI SDK responses.create method and other Responses-compatible clients with a Langdock API key. Use this endpoint for Codex and other clients that send Responses input items and read Responses output items. For integrations that send messages and read choices, use OpenAI Chat Completions.

Before You Start

  • API key: Create a personal API key or ask your workspace admin for a workspace API key with the Completion API scope.

Base URL

Dedicated deploymentsReplace api.langdock.com with <your-deployment-url>/api/public in all requests.

Parameters

Pass a string, message items, or tool results in input. Langdock forwards supported values for instructions, max_output_tokens, temperature, top_p, reasoning, text, metadata, include, truncation, service_tier, tools, tool_choice, and parallel_tool_calls. The endpoint supports native server-sent event streaming and function tools, including parallel function calls. Which settings apply depends on the selected model. The {region} path value must be eu, us, global, or ch, and must match a region where your model is available. Call GET /openai/{region}/v1/models with the same region to list models available in your workspace. The list may differ when your workspace uses Bring your own key (BYOK).

Differences from the OpenAI API

Langdock does not persist Responses API state. Send the full conversation state in each request.
  • Omit store or set it to false. store=true is rejected.
  • previous_response_id is not supported and is rejected. Pass previous messages and tool results in input.
  • Background responses are not supported. Omit background or set it to false.
  • Hosted tools such as web search, file search, code interpreter, image generation, computer use, and MCP are not supported.
  • Function tools are supported, including parallel function calls.

Using the OpenAI Python library

Set Langdock as the base URL and use responses.create:

Stream a response

Set stream=True to receive native Responses API events:

Continue a stateless tool conversation

Append the returned output items and the matching function_call_output to the next request:

Connect Codex

Create a personal API key, then open Connect your tools > Codex on Settings > Account > API keys. Choose an available OpenAI-compatible model and follow the generated setup steps for your operating system. The setup points Codex at Langdock’s Responses endpoint (wire_api = "responses") and your selected model.

Rate limits

The default limits are 500 RPM (requests per minute) and 150,000 TPM (tokens per minute).
  • RPM is enforced per workspace, model, and API key.
  • TPM is shared by all API keys using the same model in a workspace.
  • On Langdock Cloud, admins can set TPM for custom models in Settings > Workspace > Products > API; it caps the estimated size of a single request.
  • On dedicated deployments, admins can configure custom limits per model in Settings > Workspace > Products > API.
A rate-limited request returns 429 Too Many Requests. Successful and rate-limited responses include x-ratelimit-limit-requests, x-ratelimit-limit-tokens, x-ratelimit-remaining-requests, and x-ratelimit-remaining-tokens. Personal API key usage counts toward the member’s effective personal budget and the workspace spend limit together with chat and agent usage. Workspace API key usage counts toward the workspace API spend limit. See Personal API keys and Pricing.
Browser and CORS integrations are not supported. Keep API keys server-side and call the endpoint from a server, CLI, or local development tool. See API Key Best Practices.