Skip to content

[Bug]: Undefined array key "status" in Responses endpoint for Openrouter API #726

@isxam

Description

@isxam

Description

OpenAI-like Openrouter API doesn't return status field in response data, but the client require this field.

Error

Warning: Undefined array key "status" in vendor/openai-php/client/src/Responses/Responses/CreateResponse.php on line 125

Steps To Reproduce

$client = OpenAI::factory()
    ->withBaseUri('https://openrouter.ai/api/v1')
    ->withApiKey('KEY')
    ->make();
$response = $client->responses()->create([
  'model' => 'openai/o4-mini',
  'input' => [
      [
          'role' => 'user',
          'content' => 'My Prompt'
      ]
  ],
]);

OpenAI PHP Client Version

v0.18.0

PHP Version

8.2

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions