Skip to main content
POST
/
v1
/
async
/
responses
Create async response
curl --request POST \
  --url http://localhost:8080/v1/async/responses \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "input": "<string>",
  "fallbacks": [
    "<string>"
  ],
  "stream": true,
  "background": true,
  "conversation": "<string>",
  "include": [
    "<string>"
  ],
  "instructions": "<string>",
  "max_output_tokens": 123,
  "max_tool_calls": 123,
  "metadata": {},
  "parallel_tool_calls": true,
  "previous_response_id": "<string>",
  "prompt_cache_key": "<string>",
  "reasoning": {
    "effort": "none",
    "generate_summary": "<string>",
    "summary": "auto",
    "max_tokens": 123
  },
  "safety_identifier": "<string>",
  "service_tier": "<string>",
  "stream_options": {
    "include_obfuscation": true
  },
  "store": true,
  "temperature": 123,
  "text": {
    "format": {
      "type": "text",
      "name": "<string>",
      "schema": {},
      "strict": true
    },
    "verbosity": "low"
  },
  "top_logprobs": 123,
  "top_p": 123,
  "tool_choice": "none",
  "tools": [
    {
      "type": "function",
      "name": "<string>",
      "description": "<string>",
      "cache_control": {
        "type": "ephemeral",
        "ttl": "<string>"
      },
      "parameters": {
        "type": "<string>",
        "description": "<string>",
        "required": [
          "<string>"
        ],
        "properties": {},
        "enum": [
          "<string>"
        ],
        "additionalProperties": true
      },
      "strict": true,
      "vector_store_ids": [
        "<string>"
      ],
      "filters": {},
      "max_num_results": 123,
      "ranking_options": {},
      "display_height": 123,
      "display_width": 123,
      "environment": "<string>",
      "enable_zoom": true,
      "search_context_size": "<string>",
      "user_location": {},
      "server_label": "<string>",
      "server_url": "<string>",
      "allowed_tools": {},
      "authorization": "<string>",
      "connector_id": "<string>",
      "headers": {},
      "require_approval": {},
      "server_description": "<string>",
      "container": {},
      "background": "<string>",
      "input_fidelity": "<string>",
      "input_image_mask": {},
      "moderation": "<string>",
      "output_compression": 123,
      "output_format": "<string>",
      "partial_images": 123,
      "quality": "<string>",
      "size": "<string>",
      "format": {}
    }
  ],
  "truncation": "<string>"
}
'
{
  "id": "<string>",
  "status": "pending",
  "created_at": "2023-11-07T05:31:56Z",
  "expires_at": "2023-11-07T05:31:56Z",
  "completed_at": "2023-11-07T05:31:56Z",
  "status_code": 123,
  "result": "<unknown>",
  "error": {
    "event_id": "<string>",
    "type": "<string>",
    "is_bifrost_error": true,
    "status_code": 123,
    "error": {
      "type": "<string>",
      "code": "<string>",
      "message": "<string>",
      "param": "<string>",
      "event_id": "<string>"
    },
    "extra_fields": {
      "provider": "openai",
      "model_requested": "<string>",
      "request_type": "<string>"
    }
  }
}

Headers

x-bf-async-job-result-ttl
integer
default:3600

Time-to-live in seconds for the job result after completion. Defaults to 3600 (1 hour). After expiry, the job result is automatically cleaned up.

Body

application/json
model
string
required

Model in provider/model format

input
required

Input - can be a string or array of messages

fallbacks
string[]
stream
boolean
background
boolean
conversation
string
include
string[]
instructions
string
max_output_tokens
integer
max_tool_calls
integer
metadata
object
parallel_tool_calls
boolean
previous_response_id
string
prompt_cache_key
string
reasoning
object
safety_identifier
string
service_tier
string
stream_options
object
store
boolean
temperature
number
text
object
top_logprobs
integer
top_p
number
tool_choice
Available options:
none,
auto,
required
tools
object[]
truncation
string

Response

Job accepted for processing

Response returned when creating or polling an async job

id
string
required

Unique identifier for the async job

status
enum<string>
required

The status of an async job

Available options:
pending,
processing,
completed,
failed
created_at
string<date-time>
required

When the job was created

expires_at
string<date-time>

When the job result expires and will be cleaned up

completed_at
string<date-time>

When the job completed (successfully or with failure)

status_code
integer

HTTP status code of the completed operation

result
any

The result of the completed operation (shape depends on the request type)

error
object

Error response from Bifrost