Skip to main content

Overview

Async inference uses a fire-and-forget pattern for gateway requests: submit a normal inference payload to an async endpoint, get a job_id immediately, and poll later for the final result.
This is a gateway-only feature and is not available in the Go SDK and requires a Logs Store to be configured.

How It Works

Supported Endpoints

Streaming is not supported on async endpoints.

Submitting a Request

Use the same JSON body as the synchronous endpoint, but switch to the /v1/async/ path.
Response (202 Accepted)

Polling for Results

Use GET on the matching endpoint with the returned job_id.
Response codes:
  • 202 Accepted: job is still pending or processing
  • 200 OK: job is completed or failed
Pending example (202)
Completed example (200)
Failed example (200)

Job Lifecycle

Result TTL and Expiration

  • Default TTL is 3600 seconds (1 hour).
  • TTL starts from completion time, not submission time.
  • Server default is configured in client.async_job_result_ttl.
  • Per-request override uses x-bf-async-job-result-ttl.
  • If the header is invalid or <= 0, Bifrost falls back to the default TTL.
  • Expired jobs return 404 Job not found or expired.
  • Expired async jobs are cleaned up every minute.

Virtual Key Authorization

  • If a job is created with a virtual key, the job stores that virtual key identity.
  • Polling must use the same virtual key value.
  • Missing or mismatched virtual keys fail lookup and return 404 Job not found or expired.
  • Jobs created without a virtual key are not virtual-key scoped, so they can be polled by any caller that passes your gateway auth/middleware checks.

Observability

  • Async executions are logged like synchronous requests.
  • The logging metadata includes isAsyncRequest: true, which appears as an Async badge in the Logs UI.
  • Background execution still uses Bifrost request APIs, so LLM plugin hooks (governance, logging, cost tracking, etc.) are executed for the actual inference run.

Limitations

  • Gateway-only feature (not available in Go SDK).
  • Streaming is not supported on async endpoints.
  • Requires Logs Store to register async routes.
  • Jobs stuck in processing are not auto-expired by TTL cleanup. Cleanup only deletes jobs with expires_at set (completed/failed).