Responses
POST /v1/responses: a text request in the OpenAI Responses format.
/v1/responsesSends a request to a text model in the OpenAI Responses format. client.responses.create(...) from the OpenAI SDK and Codex works. The service does not store history: the store and previous_response_id fields are not supported, and every request carries the whole context.
Headers
| Header | Value |
|---|---|
Authorization | Bearer <key>. Required. x-api-key: <key> is accepted instead |
Content-Type | application/json |
X-PII-Masking | on or off. PII masking |
X-Morphogen-Space | spc_…: the spending space. Optional |
Request body
modelstringrequiredA model name from GET /v1/models.
inputstring | arrayrequiredA string or a list of input items: messages, input_image, function_call_output.
instructionsstringThe system instruction.
max_output_tokensintegerThe maximum response length. Always pass it: without it, an amount based on the model's maximum response length is reserved.
streambooleantrue turns on a streaming response with Responses events.
toolsarrayFunction descriptions for tool calls.
storebooleanOnly false or no field. true gives 400 stateful_not_supported.
previous_response_idstringNot supported. Any value gives 400 stateful_not_supported.
Request example
curl https://api.morphogen.ru/v1/responses \
-H "Authorization: Bearer $MORPHOGEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-6-luna",
"max_output_tokens": 300,
"input": "Назови столицу Франции одним словом"
}'Response example
{
"id": "resp_01HzQ4",
"object": "response",
"status": "completed",
"model": "gpt-6-luna",
"output": [
{
"type": "message",
"role": "assistant",
"content": [{ "type": "output_text", "text": "Париж" }]
}
],
"usage": { "input_tokens": 14, "output_tokens": 4, "total_tokens": 18 }
}If the model spent the whole max_output_tokens on reasoning, the response status is incomplete. In a stream, the response.incomplete event arrives in this case. Leave the model headroom in length.
Errors
stateful_not_supportedThe request has store: true or previous_response_id.invalid_jsonThe request body could not be parsed.model_category_mismatchThe model is not a text model.invalid_api_keyThe key is missing, invalid, revoked or expired.insufficient_fundsThe balance does not cover the request reserve.key_limit_exceededThe daily or monthly key limit is used up.model_not_allowedThe model is not in the key's list.model_not_foundThere is no such model in the catalog.request_too_largeThe request body is larger than 32 MiB.rate_limit_exceededThe request or token limit per minute is exceeded. Retry after the time in Retry-After.Other codes: Errors.