---
title: "Queue or Run Agent Bridge Generation"
method: POST
path: "/bridge/generate"
tags: ["Bridge"]
---

# Queue or Run Agent Bridge Generation

`POST /bridge/generate`

## Request

- Base URL: `https://synchronex.ai/api/v1`
- URL: `https://synchronex.ai/api/v1/bridge/generate`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://synchronex.ai/oauth/authorize`, token URL `https://synchronex.ai/api/oauth/token`, scopes: `read`)

Queues text generation on the user-owned local bridge when a matching CLI is live. If no bridge is reachable and the caller does not require a specific provider, falls back through the managed/BYOK generation gateway.

## Request body

- object
  - `system_prompt` string
  - `user_prompt` string, required
  - `purpose` string
  - `tier` 'haiku' | 'sonnet' | 'opus' | 'frontier'
  - `provider` 'anthropic' | 'openai' | 'gemini' | 'cursor'
  - `workspace_id` string, uuid, nullable
  - `product_id` string, uuid, nullable
  - `max_tokens` integer
  - `images` object[]
    - `name` string, required
    - `url` string, uri, required

## Response `200`

Generation completed through managed/BYOK fallback.

- object
  - `job_id` unknown, required
  - `status` 'completed', required
  - `source` 'bridge' | 'managed', required
  - `provider` string
  - `model` string, nullable
  - `result` object, required
    - `text` string

## Other responses

- `202`: Generation queued on the user-owned local bridge.
- `401`: Unauthorized. Missing, malformed, expired, or revoked bearer token.
- `403`: Forbidden. The token scope or account tier is insufficient.
- `422`: Semantic validation failed.
- `429`: Rate limit exceeded. Retry after the indicated reset time.
- `500`: Internal server error.
- `503`: No matching local bridge session is available and managed/BYOK fallback is unavailable.

---

[API](https://skmtc.dev/synchronex/apis/synchronex-api.md) · [All operations](https://skmtc.dev/synchronex/apis/synchronex-api/llms.txt) · [OpenAPI document](https://skmtc.dev/synchronex/apis/synchronex-api/revisions/aa1e0df0a8d5?raw)
