v1

latestOpenAPI 3.1.0Apache 2.02026-07-264001921002.3 KB
OpenAI Integration

Create response (OpenAI Responses API)

Creates a response using OpenAI Responses API format. Supports streaming via SSE.

Async inference: Send x-bf-async: true to submit the request as a background job and receive a job ID immediately. Poll with x-bf-async-id: <job-id> to retrieve the result. When the job is still processing, the response status will not be completed. When completed, the full response with output_text will be returned. See Async Inference for details.

Note: This endpoint also works without the /v1 prefix (e.g., /openai/responses).

post/openai/v1/responses

Headers

x-bf-async'true'

Set to true to submit this request as an async job. Returns immediately with a job ID. Not compatible with streaming.

x-bf-async-idstring

Poll for results of a previously submitted async job by providing the job ID returned from the initial async request.

x-bf-async-job-result-ttlinteger

Override the default result TTL in seconds. Results expire after this duration from completion time.

Request body

modelstring required

Model identifier

streamboolean
instructionsstring

System instructions for the model

max_output_tokensinteger
metadataobject
parallel_tool_callsboolean
previous_response_idstring
storeboolean
temperaturenumber
top_pnumber
truncation'auto' | 'disabled'
userstring
fallbacksstring[]

Example request

{
  "model": "gpt-4"
}

Response

Successful response

idstring
backgroundboolean
conversationobject
created_atinteger
includestring[]
instructionsobject
max_output_tokensinteger
max_tool_callsinteger
metadataobject
modelstring
parallel_tool_callsboolean
previous_response_idstring
promptobject
prompt_cache_keystring
safety_identifierstring
service_tierstring
status'completed' | 'failed' | 'in_progress' | 'canceled' | 'queued' | 'incomplete'
stop_reasonstring
storeboolean
temperaturenumber
top_logprobsinteger
top_pnumber
truncationstring
citationsstring[]