Skip to main content
POST
Creates a stateless model response.
Using the API through a dedicated deployment? Replace api.langdock.com with your deployment’s base URL: <deployment-url>/api/public
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.
To use the API, create a personal API key or ask your workspace admin for a workspace API key with the Completion API scope. Personal keys only include the Completion API scope.
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.

Supported fields

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, or global, 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 60,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 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 extra usage budget 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.

Authorizations

Authorization
string
header
required

API key as Bearer token. Format "Bearer YOUR_API_KEY"

Path Parameters

region
enum<string>
required

The region of the API to use.

Available options:
eu,
us,
global

Body

application/json
model
string
required

The model ID. Use the models endpoint to list models available in your workspace.

input
required

The input text or full conversation state to process.

instructions
string | null

Instructions added to the model context.

max_output_tokens
integer | null

The maximum number of output tokens.

Required range: x >= 1
temperature
number | null

Controls response randomness.

top_p
number | null

Controls nucleus sampling.

stream
boolean | null
default:false

Whether to return native Responses API server sent events.

tools
object[]

Function tool definitions. Hosted tools are not supported.

tool_choice

Controls whether the model can call a function.

Available options:
none,
auto,
required
parallel_tool_calls
boolean | null

Whether the model can return multiple function calls.

reasoning
object

OpenAI Responses reasoning configuration.

text
object

OpenAI Responses text output configuration.

metadata
object | null

String metadata attached to the request.

store
enum<boolean> | null

Responses are not persisted. Omit this field or set it to false.

Available options:
false
background
enum<boolean> | null

Background responses are not supported.

Available options:
false
include
string[] | null

Additional response fields to include.

truncation
enum<string> | null
Available options:
auto,
disabled
service_tier
string | null

The OpenAI service tier forwarded to the model provider.

Response

Successful response or event stream.

A response returned by the OpenAI-compatible Responses endpoint.

id
string
required

Unique identifier for the response.

Example:

"resp_09e99d1f7f163d10016a678387353481"

object
enum<string>
required

The object type, which is always response.

Available options:
response
created_at
integer
required

Unix timestamp in seconds when the response was created.

Example:

1785168775

status
enum<string>
required

Current response status.

Available options:
completed,
failed,
in_progress,
cancelled,
queued,
incomplete
Example:

"completed"

model
string
required

Model used to generate the response.

Example:

"gpt-5-mini-2025-08-07"

output
object[]
required

Output items generated by the model.

Reasoning information generated by a reasoning model.

completed_at
integer | null

Unix timestamp in seconds when the response completed.

Example:

1785168778

background
enum<boolean>

Langdock does not support background responses.

Available options:
false
output_text
string

Aggregated text from all output_text items.

error
object | null

Error information when the response failed.

incomplete_details
object | null

Details explaining why the response is incomplete.

instructions
string | null

Instructions used for the response.

max_output_tokens
integer | null

Maximum number of output tokens configured for the response.

parallel_tool_calls
boolean

Whether the model can return multiple function calls.

reasoning
object | null

Reasoning configuration used for the response.

store
enum<boolean>

Langdock Responses are never persisted.

Available options:
false
temperature
number | null

Sampling temperature used for the response.

text
object | null

Text output configuration used for the response.

service_tier
string | null

Service tier used to process the response.

tool_choice

Tool choice used for the response.

tools
object[]

Function tools available to the model.

top_p
number | null

Nucleus sampling value used for the response.

truncation
enum<string>

Truncation strategy used for the response.

Available options:
auto,
disabled
usage
object

Token usage for the response.

metadata
object | null

Metadata attached to the request.