GET /v1/responses/{response_id} in a loop. Attach a callback URL to the request and Valar delivers the finished result to your server as an HTTP POST. The feature works on POST /v1/responses, POST /v1/chat/completions, and POST /v1/messages, and is configured entirely through two metadata keys.
Parameters
Both keys live inside themetadata object on the create request. The same keys apply to Chat Completions and Anthropic Messages requests.
The destination URL for the callback. Must be an
http or https URL. If you omit it or pass a value that can’t be used, no callback is sent and the request itself is unaffected.An optional shared secret. Valar sends its value as a Bearer token in the callback’s
Authorization header so your endpoint can confirm the request is genuine.Set up an endpoint
Expose a route that accepts POST
Your endpoint receives a JSON body and should respond as soon as it has accepted the payload. The body matches exactly what
GET /v1/responses/{response_id} returns for the same request.Verify the Authorization header
If you set
webhook_token, reject any incoming call whose header doesn’t match. Compare against Authorization: Bearer <your token> and return a 4xx for anything else.What Valar sends
The callback is a single POST request.Always a POST to the URL in
completion_webhook.application/json.Present only when
webhook_token was set. Carries Bearer <webhook_token>.The full response object, byte-for-byte identical to a
GET /v1/responses/{response_id} call. The response id lives here and is your key for deduplication.Delivery semantics
- Retries. A delivery that returns a non-2xx status or hits a network error is retried up to 3 times. Return a 2xx as soon as you accept the payload to stop the retries.
- Timeout. Each attempt has a 30 second ceiling. A timeout counts as a failed attempt and triggers the next retry.
- Best-effort. Callbacks are best-effort. A failure is logged but never touches the response record or the API, and the result stays available through
GET /v1/responses/{response_id}regardless of whether delivery ever succeeded.