-
Notifications
You must be signed in to change notification settings - Fork 16
Description
Version 0.3.10
Code example:
const result = await openRouter.beta.responses.send({
model: "anthropic/claude-haiku-4.5",
input: [
{
role: "user",
content: "What is the capital of England?",
},
],
reasoning: {
effort: "low",
enabled: true,
},
});
console.log(JSON.stringify(result, null, 2));Expected (from direct API call):
{
"type": "reasoning",
"id": "rs_tmp_n0i9n8f49b",
"summary": [],
"content": [...],
"signature": "EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj...",
"format": "anthropic-claude-v1"
}Actual from openRouter.beta.response.send():
{
"type": "reasoning",
"id": "rs_tmp_s9mddj1ej0m",
"content": [...],
"summary": []
// Missing: "signature" and "format"
}This is an issue for Anthropic models.
OpenAI and Google models seem OK as they use encryptedContent, but format is missing from all 3.
Here is some analysis from Composer if that helps:
Root Cause
The SDK is correctly following the OpenAPI specification, but the specification is incomplete:
-
Reasoning Output Items: The
outputarray schema usesOutputItemReasoningwhich doesn't includesignatureandformatfields. However, there's a separate schemaOpenResponsesReasoningthat extendsOutputItemReasoningand includes these fields, but it's not used in the response schema. -
Reasoning Config: The
OpenAIResponsesReasoningConfigschema only defineseffortandsummaryfields, but the API actually returns anenabledfield as well.
Technical Details
OpenAPI Schema Location
- Reasoning Output Schema:
.speakeasy/in.openapi.yamllines 226-261 (OutputItemReasoning) - Extended Schema with Fields:
.speakeasy/in.openapi.yamllines 3213-3236 (OpenResponsesReasoning) - Response Schema:
.speakeasy/in.openapi.yamllines 1192-1210 (usesOutputItemReasoninginstead ofOpenResponsesReasoning) - Reasoning Config Schema:
.speakeasy/in.openapi.yamllines 19-23 (OpenAIResponsesReasoningConfig)
SDK Model Files
- Reasoning Output Model:
src/models/responsesoutputitemreasoning.ts - Reasoning Config Model:
src/models/openairesponsesreasoningconfig.ts - Response Model:
src/models/openresponsesnonstreamingresponse.ts