Create response
Creates a model response using the stateless Responses API. An alternative to /v2/chat/completions with a simpler input format and richer streaming events.
Accepts a plain string or an array of input items (messages and tool outputs). The store field must be omitted or set to false — only stateless mode is supported.
Prompt caching (Anthropic models). Cache lifetime is five minutes only — ttl: "1h" is
NOT supported on this endpoint. Mark the last element of a stable prefix with
cache_control and that prefix is cached upstream, so a later request that repeats it
byte-for-byte is billed at the cache-read rate. Nothing is cached unless you ask: we never
insert breakpoints on your behalf, because whether a cache write pays for itself depends
on your access pattern, not on ours. Every cache lives five minutes — ttl: "1h" is
accepted but not supported yet, and is reported as marker_ttl_unsupported rather than
applied. prompt_cache in the response carries that warning plus any marker we could not
place exactly as written. See Billing → Prompt caching.
Prompt caching (Mistral models). Mistral caches prefixes automatically, so cache_control
does nothing there — send prompt_cache_key instead: one stable string per conversation or
session, repeated on every request that shares a prefix. It is applied unconditionally and
costs nothing extra (Mistral has no cache-write premium), your value is namespaced to your
workspace, and a hit is a likelihood rather than a guarantee. See
Billing → Mistral models.
https://api.deutschlandgpt.de/v2/responsesExample request
curl https://api.deutschlandgpt.de/v2/responses \
-X POST \
-H "Authorization: Bearer $DGPT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"instructions": "You are a concise assistant. Answer in German.",
"input": "",
"stream": false,
"temperature": 0,
"max_output_tokens": 0,
"tools": [
{
"type": "function",
"name": "string",
"parameters": {}
}
],
"tool_choice": "auto",
"parallel_tool_calls": true,
"text": {},
"reasoning": {},
"store": true,
"prompt_cache_key": "conversation-42",
"reasoning_effort": "none"
}'curl https://api.deutschlandgpt.de/v2/responses \
-X POST \
-H "Authorization: Bearer $DGPT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"instructions": "You are a concise assistant. Answer in German.",
"input": "",
"stream": false,
"temperature": 0,
"max_output_tokens": 0,
"tools": [
{
"type": "function",
"name": "string",
"parameters": {}
}
],
"tool_choice": "auto",
"parallel_tool_calls": true,
"text": {},
"reasoning": {},
"store": true,
"prompt_cache_key": "conversation-42",
"reasoning_effort": "none"
}'import os, requests
response = requests.post(
"https://api.deutschlandgpt.de/v2/responses",
headers={"Authorization": f"Bearer {os.environ['DGPT_API_KEY']}"},
json={
"model": "gpt-4o",
"instructions": "You are a concise assistant. Answer in German.",
"input": "",
"stream": False,
"temperature": 0,
"max_output_tokens": 0,
"tools": [
{
"type": "function",
"name": "string",
"parameters": {}
}
],
"tool_choice": "auto",
"parallel_tool_calls": True,
"text": {},
"reasoning": {},
"store": True,
"prompt_cache_key": "conversation-42",
"reasoning_effort": "none"
},
)
print(response.json())import os, requests
response = requests.post(
"https://api.deutschlandgpt.de/v2/responses",
headers={"Authorization": f"Bearer {os.environ['DGPT_API_KEY']}"},
json={
"model": "gpt-4o",
"instructions": "You are a concise assistant. Answer in German.",
"input": "",
"stream": False,
"temperature": 0,
"max_output_tokens": 0,
"tools": [
{
"type": "function",
"name": "string",
"parameters": {}
}
],
"tool_choice": "auto",
"parallel_tool_calls": True,
"text": {},
"reasoning": {},
"store": True,
"prompt_cache_key": "conversation-42",
"reasoning_effort": "none"
},
)
print(response.json())const response = await fetch('https://api.deutschlandgpt.de/v2/responses', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.DGPT_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"model": "gpt-4o",
"instructions": "You are a concise assistant. Answer in German.",
"input": "",
"stream": false,
"temperature": 0,
"max_output_tokens": 0,
"tools": [
{
"type": "function",
"name": "string",
"parameters": {}
}
],
"tool_choice": "auto",
"parallel_tool_calls": true,
"text": {},
"reasoning": {},
"store": true,
"prompt_cache_key": "conversation-42",
"reasoning_effort": "none"
}),
});
console.log(await response.json());const response = await fetch('https://api.deutschlandgpt.de/v2/responses', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.DGPT_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"model": "gpt-4o",
"instructions": "You are a concise assistant. Answer in German.",
"input": "",
"stream": false,
"temperature": 0,
"max_output_tokens": 0,
"tools": [
{
"type": "function",
"name": "string",
"parameters": {}
}
],
"tool_choice": "auto",
"parallel_tool_calls": true,
"text": {},
"reasoning": {},
"store": true,
"prompt_cache_key": "conversation-42",
"reasoning_effort": "none"
}),
});
console.log(await response.json());Request body
modelstringrequiredModel ID to use (e.g. gpt-4o, o4-mini). Use /v2/models to list available models.
instructionsstring | nulloptionalA system (or developer) message inserted as the first item in the model's context. The equivalent of a system message on /v2/chat/completions. If your input array already contains a system or developer item, this text is prepended to it — the endpoint supports one system message per request.
inputstring | object[]optionalText, image, or file inputs. Pass a string for a single user turn or an array of input items for multi-turn conversations.
streambooleanoptionalStream the response as server-sent events. Events are JSON objects with a type field (e.g. response.output_text.delta, response.completed).
temperaturenumberoptionalSampling temperature (0–2). Higher = more varied output.
max_output_tokensintegeroptionalUpper bound on tokens to generate. Alias: max_completion_tokens.
toolsobject[]optionalFunctions the model may call. Uses flat format — no nested function object.
typestringrequirednamestringrequireddescriptionstringoptionalparametersobjectrequiredJSON Schema for function parameters
strictbooleanoptionalcache_controlCacheControloptionalCache the tool definitions (and the system prompt with them, since Anthropic orders tools first). Requires a system message in the same request — with none, the marker is dropped rather than moved onto the first user turn, which would change every request and never produce a hit.
typestringrequiredttlstringoptionalCache lifetime. On THIS endpoint 1h is NOT SUPPORTED: it is accepted so an existing integration keeps working, but the breakpoint is placed with the default five-minute lifetime, billed at the five-minute cache-write rate (1.25x the input rate, not 2x), and reported as a marker_ttl_unsupported warning in prompt_cache. Because every breakpoint therefore has the same lifetime, mixing the two values is accepted and Anthropic's 1h-before-5m ordering rule is not enforced. 1h IS honoured on /anthropic/v1/messages, where cache_control is Anthropic's own field. Where nothing is cached the markers are ignored entirely.
tool_choicestring | objectoptionalControls which (if any) tool is called.
parallel_tool_callsbooleanoptionalAllow the model to call multiple tools in a single turn.
textobjectoptionalOutput format and verbosity configuration.
formatobject | objectoptionalOutput format. Use json_schema for structured output (streaming not supported).
verbositystringoptionalConstrains response length. low = concise, high = detailed.
reasoningobjectoptionalReasoning model configuration (for o3, o4-mini, etc.).
effortstringoptionalReasoning intensity. none disables extended thinking and is forwarded to the model as such, so no reasoning tokens are generated or billed. Not every reasoning model accepts every value.
summarystring | nulloptionalRequest a summary of the reasoning the model performed, returned as reasoning output items (and as response.reasoning_summary_* events when streaming). Only produced by reasoning models, and only when the effort is above none.
generate_summarystring | nulloptionalDeprecated alias for summary, accepted for older OpenAI SDKs. Prefer summary; if both are set, summary wins.
storebooleanoptionalAccepted for OpenAI-SDK compatibility but always treated as false — only stateless mode is supported. Setting true does not error; the response is still not stored.
prompt_cache_keystringoptionalOptional stable identifier for requests that share a prompt prefix — a conversation, session or workflow id. Raises the prompt-cache hit rate on models that cache prefixes automatically (Mistral). Ignored by models that cache on explicit cache_control breakpoints (Anthropic) and by models with no prompt cache. Your value is namespaced to your workspace server-side, so it can never collide with another tenant or aim at their cache. Hits are best-effort and never guaranteed — a miss is billed exactly like an uncached request, so there is nothing to lose by sending it. Do not put secrets or personal data in it.
reasoning_effortstringoptionalAlias for reasoning.effort, accepted so a /v2/chat/completions request body works unchanged on this endpoint. reasoning.effort wins if both are supplied.
Response
{
"id": "resp_abc123",
"object": "response",
"created_at": 0,
"status": "completed",
"model": "string",
"output": [
{
"id": "string",
"type": "message",
"role": "assistant",
"content": [
{
"type": null,
"text": null,
"annotations": null
}
]
}
],
"usage": {
"input_tokens": 0,
"output_tokens": 0,
"total_tokens": 0,
"input_tokens_details": {
"cached_tokens": 0,
"cache_write_tokens": 0
}
},
"prompt_cache_key": "string"
}{
"id": "resp_abc123",
"object": "response",
"created_at": 0,
"status": "completed",
"model": "string",
"output": [
{
"id": "string",
"type": "message",
"role": "assistant",
"content": [
{
"type": null,
"text": null,
"annotations": null
}
]
}
],
"usage": {
"input_tokens": 0,
"output_tokens": 0,
"total_tokens": 0,
"input_tokens_details": {
"cached_tokens": 0,
"cache_write_tokens": 0
}
},
"prompt_cache_key": "string"
}Response object or SSE stream when stream: true
Also available as text/event-stream
idstringobjectstringcreated_atintegerUnix timestamp
statusstringmodelstringoutputobject[]idstringtypestringrolestringcontentobject[]typestringtextstringannotationsobject[]usageobjectinput_tokensintegeroutput_tokensintegertotal_tokensintegerinput_tokens_detailsobjectThe cache split of input_tokens, which is the INCLUSIVE total.
cached_tokensintegerInput tokens served from the prompt cache, billed at the cache-read rate when prompt caching is enabled for your organisation.
cache_write_tokensintegerInput tokens written to the prompt cache. Present only when prompt caching is enabled for your organisation.
prompt_cache_keystring | nullThe prompt_cache_key you sent, echoed back. null when you sent none.
Response codes
Response object or SSE stream when stream: true
Invalid request or stream: true with json_schema
Missing or invalid API key
ErrorInsufficient credits
ErrorFeature not enabled
ErrorModel not found
Error