What Happened?
- Tool calls fail when using Responses API via Portkey
- Works fine when using direct OpenAI (ChatOpenAI)
- Bedrock errors:
messages.1 content is empty
toolResult blocks exceed toolUse blocks
- Azure OpenAI error via Portkey:
ModelNotFound even though model exists
- Completion API works for tool calls but fails for file inputs
- File-related errors:
- Azure: missing
messages[1].content[0].file
- Bedrock: invalid
DocumentSource (expects bytes or s3Location)
What Should Have Happened?
- Tool calls should work consistently via Portkey with Responses API
- File inputs should be handled correctly across providers
- Azure models should resolve correctly via Portkey
- Behavior should match direct provider integrations
Relevant Code Snippet
// not working
const azureChatOpenAI = new ChatOpenAI({
model: '@openai-5-4-studio/gpt-5.4',
useResponseApi:true,
configuration: {
baseURL: 'https://api.portkey.ai/v1',
apiKey: config.portkey.apiKey,
defaultHeaders: {
'x-portkey-metadata': metadata,
},
},
});
// working
const azureChatOpenAI = new ChatOpenAI({
model: 'gpt-5.4-studio',
useResponseApi:true,
configuration: {
baseURL: azureBaseUrl,
apiKey: azureApiKey
},
});
Your Twitter/LinkedIn
https://x.com/thenileshdarji
What Happened?
messages.1 content is emptytoolResult blocks exceed toolUse blocksModelNotFoundeven though model existsmessages[1].content[0].fileDocumentSource(expects bytes or s3Location)What Should Have Happened?
Relevant Code Snippet
Your Twitter/LinkedIn
https://x.com/thenileshdarji