API reference
Create a response (OpenAI Responses API)
/v1/responsesResponses text and tool-call endpoint; optional fields and tool types depend on the model. stream=true returns typed SSE events; previous_response_id does not guarantee persistent storage or recovery.
Authentication and permissions
Use your current GloopAPI key. Available models, capabilities and permissions depend on its catalog and the endpoint documentation.
Authorization: Bearer $GLOOP_API_KEYAuthentication schemes: BearerAuth
Request
Request body · application/json
- Type
- object
- Required fields
modelinput
Request body required
modelstringRequiredinputunionRequiredInput content, as a string or message array
oneOf branch 1
Type: string
instructionsstringOptionalmax_output_tokensintegerOptionaltemperaturenumberOptionalSampling temperature. Specific support and limits depend on the selected model; no uniform defaults are guaranteed.
top_pnumberOptionalNucleus sampling parameter. Specific support and limits depend on the selected model; no uniform defaults are guaranteed.
streambooleanOptionaltoolsarrayOptionaltools child fields (1)
[]objectOptional
tool_choiceunionOptionaloneOf branch 1
Type: string
oneOf branch 2
Type: object
reasoningobjectOptionalprevious_response_idstringOptionaltruncationstringOptional- Enum
["auto","disabled"]
parallel_tool_callsbooleanOptionalWhether parallel tool calls are allowed depends on the selected model. Chat accepts a boolean; Responses accepts compatible protocol JSON values.
storebooleanOptionalWhether requests and responses may be stored depends on the selected model and supported service capabilities. This does not provide a general conversation storage API.
prompt_cache_keystringOptionalprompt cache correlation identifier; model dependent, with no guarantee of a cache hit or support. Chat accepts a string; Responses accepts compatible protocol JSON values.
prompt_cache_retentionunknownOptionalprompt cache retention control as a JSON value; model dependent. The platform provides no uniform enum, default, or cache retention guarantee.
service_tierstringOptionalRequested service tier, which may affect charges. Ignored by default and effective only when supported. Accepted values depend on the selected model.
textobjectOptionalText output configuration, including format for structured output; support and limits depend on the selected model.
text child fields (1)
formatobjectOptionalText and structured output format configuration, depending on the model.
format child fields (4)
typestringOptionalOutput format identifiers supported by the selected model.
namestringOptionalStructured output name.
schemaobjectOptionalJSON Schema for structured output; must satisfy the selected model requirements.
- Additional properties
true
strictbooleanOptionalWhether to require strict structured output, depending on the model.
context_managementunknownOptionalContext management configuration; model dependent, with no promise of automatic summarization or persistent memory.
stream_optionsobjectOptionalResponses streaming parameters; use with stream=true. Only supported fields take effect.
stream_options child fields (2)
include_usagebooleanOptionalRequest streaming usage; availability depends on the model.
include_obfuscationbooleanOptionalResponses stream obfuscation control; ignored by default, effective only when supported.
Responses and errors
HTTP 200
Response created successfully
application/json
- Type
- object
- Additional properties
- false
idstringOptionalobjectstringOptionalcreated_atintegerOptionalstatusstringOptional- Enum
["completed","failed","in_progress","incomplete"]
modelstringOptionaloutputarrayOptionaloutput child fields (1)
[]objectOptional- Additional properties
false
[] child fields (8)
typestringOptionalidstringOptionalstatusstringOptionalrolestringOptionalcontentarrayOptionalcontent child fields (1)
[]objectOptional- Additional properties
false
[] child fields (3)
typestringOptional- Enum
["output_text","refusal"]
textstringOptionalannotationsarrayOptionalannotations child fields (1)
[]objectOptional
call_idstringOptionalnamestringOptionalargumentsstringOptional
usageobjectOptionalusage child fields (5)
prompt_tokensintegerOptionalPrompt token count
completion_tokensintegerOptionalCompletion token count
total_tokensintegerOptionalTotal token count
prompt_tokens_detailsobjectOptionalprompt_tokens_details child fields (4)
cached_tokensintegerOptionaltext_tokensintegerOptionalaudio_tokensintegerOptionalimage_tokensintegerOptional
completion_tokens_detailsobjectOptionalcompletion_tokens_details child fields (3)
text_tokensintegerOptionalaudio_tokensintegerOptionalreasoning_tokensintegerOptional
text/event-stream
- Type
- string
- Description
- SSE event stream. Protocol events, usage, and terminators depend on the current endpoint; errors may occur inside the stream.
{
"type": "string",
"description": "SSE 事件流,协议事件/用量/结束符取当前接口,错误可能在流内。"
}HTTP 401
The key is missing, invalid, expired, or revoked.
application/json
- Type
- object
- Required fields
error
errorobjectRequirederror child fields (4)
codestringOptionalmessagestringOptionaltypestringOptionalrequest_idstringOptional
HTTP 403
Insufficient IP, account, model, or tool permissions.
application/json
- Type
- object
- Required fields
error
errorobjectRequirederror child fields (4)
codestringOptionalmessagestringOptionaltypestringOptionalrequest_idstringOptional
HTTP 429
Request/queue rate limit.
application/json
- Type
- object
- Required fields
error
errorobjectRequirederror child fields (4)
codestringOptionalmessagestringOptionaltypestringOptionalrequest_idstringOptional
HTTP 500
Internal authentication or data storage failure.
application/json
- Type
- object
- Required fields
error
errorobjectRequirederror child fields (4)
codestringOptionalmessagestringOptionaltypestringOptionalrequest_idstringOptional