Skip to content

Add Background & Queue Support for OpenAI #590

@ianhawes

Description

@ianhawes

The OpenAI Responses API allows for background processing of messages. Currently, Prism filters out the provider options in Prism\Prism\Providers\OpenAI\Handlers\Text and Prism\Prism\Providers\OpenAI\Handlers\Structured to prevent background from being specified.

A queued response will look like this:

{
  "id": "resp_abc123xyz",
  "object": "response",
  "created_at": 1756644282,
  "status": "queued",
  "background": true,
  "error": null,
  "max_output_tokens": 4092,
  "model": "gpt-5-2025-08-07",
  "output": [],
  "store": true,
}

(some properties removed for brevity)

In order to support this setting, an additional check will need to be conducted in handle() to look for a status of queued and return the relevant response_id for future polling and retrieval.

Beyond supporting background in a request, it would be nice to also have support for:

  • Confirming the authenticity of signed OpenAI webhooks
  • Serializing and deserializing responses into Prism objects and vice-versa

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions