Develop / Reference
Responses
Generates and manages responses in the format of the OpenAI Responses API and inspects instructions and input with Noirdoc Shield when Shield is active.
/v1/responses - Family
- chat
- Shield
- yes
- Streaming
- yes, SSE
- Format
- JSON
- Billing
- tokens
Request
The gateway accepts the body in the format of the OpenAI Responses API. model is required. Use a model ID from GET /v1/models. The model must belong to the chat family and run at a provider in the OpenAI format.
The Responses API is served by models from providers that offer this API in the OpenAI format. GET /v1/models returns the models your key may call. For this endpoint, the endpoint_family field there has the value chat. The provider decides whether it supports the Responses API. If it rejects the request, you receive its status code and message under the code provider_rejected_request.
curl https://api.noirdoc.de/v1/responses \
-H "Authorization: Bearer $NOIRDOC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "<model-id>",
"instructions": "Answer in three sentences.",
"input": "What does Mr Müller write to the firm?"
}'import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.noirdoc.de/v1",
api_key=os.environ["NOIRDOC_API_KEY"],
)
response = client.responses.create(
model="<model-id>",
instructions="Answer in three sentences.",
input="What does Mr Müller write to the firm?",
)
print(response.output_text)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.noirdoc.de/v1",
apiKey: process.env.NOIRDOC_API_KEY,
});
const response = await client.responses.create({
model: "<model-id>",
instructions: "Answer in three sentences.",
input: "What does Mr Müller write to the firm?",
});
console.log(response.output_text);What Noirdoc changes
| Area | Behaviour |
|---|---|
| Model | The gateway resolves the model ID through the catalogue and sends the provider its own model name. If the response’s model field contains this name, the gateway replaces it with the ID you sent. |
| Provider | The X-Noirdoc-Provider header in the response names the provider, including on a provider error. For streams, the header is missing if the provider answers only after 15 seconds; a comment line : provider=<slug> then names the provider, see Streaming. See Providers & routing. |
| Noirdoc Shield | When Shield is active, the gateway replaces sensitive values in instructions and input in-place with fixed placeholders ([PERSON], [IBAN], …) or rejects the request with 403 shield_violation on a block match (such as secrets or prompt injection) — without prepending an instruction, modifying the model response or holding back stream chunks. Inspected fields lists the inspected fields. Reversible placeholder masking (<<PERSON_1>>) applies only to pre-existing legacy organisations until 30.11.2026 (Legacy masking). |
previous_response_id | Under Noirdoc Shield, previous_response_id needs no Redis mapping store because placeholders such as [PERSON] are one-way and responses pass through unchanged. Only pre-existing organisations on legacy masking until 30.11.2026 load the previous response’s mapping to translate placeholders back. |
| Files and images | Parts of type input_image and input_file are allowed only if admins of your organisation have turned on Allow file and image attachments in requests under Models → Shield (Advanced Settings). Shield inspects inline UTF-8 text files under 4 MiB directly; binary PDFs or images return X-Noirdoc-Shield: partial; redacted=<n> or 422 shield_uninspectable_content under enforced. Details: Files and images and Files. |
| Headers | The gateway removes your key, X-Noirdoc-Shield and X-Noirdoc-Mask before forwarding the request. |
References to stored objects
The providers managed by Noirdoc use one shared account for all organisations. There, the gateway checks every reference in the body:
previous_response_id, referenced files (file_id) and containers must have been created through your organisation. Otherwise, the gateway answers with 404object_not_found.- The gateway rejects
conversation,prompt.id,input[]items of typeitem_reference,input[]items that carry only anidwithout content, andtools[].vector_store_idswith 403reference_not_available_on_platform.
With your own provider key (BYOK), these checks do not apply.
Storage at the provider
By default, the Responses API stores input and response at the provider (store). With the providers managed by Noirdoc, the gateway sets store to false unless admins of your organisation have turned on Allow Responses API storage at provider under Models → Shield. New organisations start with the option off; organisations that existed before it was introduced keep it on. As long as it is off, the gateway rejects "store": true, previous_response_id and the sub-routes with {id} with 403 stored_responses_disabled. In that case, send the previous history in input with every request; reasoning models remain usable without storage through include: ["reasoning.encrypted_content"]. With your own provider key (BYOK), the setting does not apply.
| Status | Code | Meaning |
|---|---|---|
| 403 | stored_responses_disabled | The request would store input and response at the managed provider (store, previous_response_id or a sub-route for stored responses), and your organisation has not turned on storage at the provider. |
Sub-routes
| Method | Path | Purpose |
|---|---|---|
POST | /v1/responses | generate a response |
POST | /v1/responses/input_tokens | count the input tokens of a request |
POST | /v1/responses/compact | forward to the provider endpoint responses/compact |
GET | /v1/responses/{id} | retrieve a stored response |
DELETE | /v1/responses/{id} | delete a stored response |
POST | /v1/responses/{id}/cancel | cancel a running response (without a body) |
GET | /v1/responses/{id}/input_items | retrieve the input items of a response |
input_tokens and compact require model and run through the catalogue like POST /v1/responses. On compact, Noirdoc Shield inspects instructions and input just like on POST /v1/responses when Shield is active; POST /v1/responses/input_tokens skips Noirdoc Shield at €0.
The calls with {id} carry no model. The gateway forwards them to your organisation’s oldest active provider in the OpenAI format. Your own provider keys (BYOK) take precedence. With providers managed by Noirdoc, you reach only responses that were created through your organisation, and only if the Allow Responses API storage at provider option is on (see Storage at the provider). For all other IDs, the gateway answers with 404 object_not_found.
Stored responses (GET /v1/responses/{id} and input_items) retain one-way Shield placeholders such as [PERSON] (and under legacy masking until 30.11.2026, placeholders are not translated back on retrieval either).
The gateway answers other paths under /v1/responses/ with 404 unsupported_endpoint.
input_tokens generates no model response. The gateway logs the call, skips Shield and bills €0. There is no cost estimate before forwarding. With providers managed by Noirdoc, the following still applies: if the organisation’s credit or the key’s budget is used up, the gateway answers with 402. The gateway bills compact by tokens (plus Shield when active) like POST /v1/responses.
Errors on this endpoint
| Status | Code | Meaning |
|---|---|---|
| 400 | model_required | The request names no model (model in the body, or in the form field for /v1/audio/transcriptions). |
| 400 | wrong_endpoint_for_model | The model belongs to a different endpoint family or API format than the endpoint called. |
| 400 | invalid_request_body | The body is not a JSON object or not encoded in UTF-8. |
| 402 | insufficient_credit | The organisation's credit is used up or lower than the estimated maximum cost of the request (including Noirdoc Shield, also on BYOK routes when Shield is active). |
| 402 | key_budget_exhausted | This key's budget is used up for the current period or does not cover the estimated cost of the request. |
| 403 | reference_not_available_on_platform | The body refers to objects at the provider (such as conversation, prompt.id or vector_store_ids) whose ownership the gateway cannot check for managed providers. |
| 403 | model_not_allowed_for_key | The model is not one of this key's allowed models. |
| 403 | provider_not_allowed_for_tenant | The organisation counts as bound by professional secrecy (§ 203 StGB); this excludes every provider that offers this model. |
| 403 | provider_not_allowed_for_key | The key's restrictions (providers, data residency, CLOUD Act, § 203) exclude every provider of this model. |
| 403 | starter_model_not_allowed | The organisation is still using only its starter credit, and the model or its managed provider is not included in starter credit. |
| 403 | shield_violation | Noirdoc Shield blocked the request before forwarding to the provider because an active protection filter configured with block matched; message names the triggered rule (secrets, pii, ner, injection or custom). |
| 403 | file_content_not_allowed | The request contains files, images or audio, and the organisation does not allow file content. |
| 403 | file_pii_blocked | A file contains personal data, and the organisation's legacy file analysis (transition until 30.11.2026) is set to block or to detect_only under enforced. |
| 404 | object_not_found | The object (file, skill or stored response) does not exist or does not belong to your organisation. |
| 404 | model_not_available | The model ID is not available to the organisation. |
| 413 | shield_input_too_large | The text to inspect in this request exceeds the Shield service limit of 4 MiB of encoded text in a single call. |
| 422 | shield_uninspectable_content | The Shield policy is enforced, and the request carries content that Shield cannot inspect as text (binary_document such as PDF or Office, media_not_inspectable such as images, audio or video, file_reference by ID or URL, file_too_large at 4 MiB or above, file_not_decodable or unrecognised_content). The gateway did not forward the request. |
| 422 | shield_config_invalid | The organisation's stored Shield configuration is invalid (for example enforced without any active protection filter, or a pattern that fails compilation); the gateway did not forward the request. |
| 422 | file_unprocessable | A file could not be processed in legacy file analysis (transition until 30.11.2026): it is too large, unreadable or in a format without analysis. The gateway did not forward the request. |
| 500 | detection_error | Detecting personal data in legacy masking (transition until 30.11.2026) failed; the gateway did not forward the request. |
| 502 | provider_not_configured | The organisation has no suitable provider set up for this request. |
| 502 | provider_unreachable | The gateway could not connect to the provider, or the connection dropped. |
| 503 | ownership_check_unavailable | The gateway could not check just now whether the object belongs to your organisation and rejected the request. The response contains Retry-After with 5 seconds. |
| 503 | shield_unavailable | The Noirdoc Shield inspection service is temporarily unreachable; the gateway never forwards a request that requires inspection uninspected (fail-closed). The response contains Retry-After with 5 seconds. |
| 504 | provider_timeout | The provider did not answer within the gateway's timeout. The response contains Retry-After with 10 seconds. |
OpenAI reference
OpenAI’s API reference describes all other request and response fields: Responses (checked on 30 September 2026).