Skip to content

docs: clarify Realtime API createHeaders examples and correct authentication usage#759

Open
naresh4dev wants to merge 1 commit intoPortkey-AI:mainfrom
naresh4dev:fix/realtime-api-createHeaders-examples
Open

docs: clarify Realtime API createHeaders examples and correct authentication usage#759
naresh4dev wants to merge 1 commit intoPortkey-AI:mainfrom
naresh4dev:fix/realtime-api-createHeaders-examples

Conversation

@naresh4dev
Copy link

  • Updates the createHeaders examples to avoid confusion where two providers were shown or the usage was ambiguous. The current docs reference conflicting provider usage in createHeaders and do not clearly explain how Portkey authentication should be implemented for Realtime API calls
  • Adds correct guidance around Portkey API key vs OpenAI key usage, including explicitly stating that api_key="dummy" is not required in the published examples, and that the Portkey API key should be passed instead. This fixes an omission where the docs did not show the recommended header pattern used in other integration pages.
  • Clarifies that Realtime API users should authenticate using Portkey credentials via createHeaders(provider, apiKey) rather than incorrectly passing OpenAI API key into the client’s api_key property when routing through Portkey.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this will work afaik API key is probably needed in the async open AI client.

Also, now with Portkey's new model catalog, you actually do not need the create headers method. You can just directly use the async open AI client and then pass the model in the model field with the rate provider slug/model ID.

Copy link
Collaborator

@vrushankportkey vrushankportkey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on api_key - send PORKTEY_API_KEY

No need to send provider header as well. Just send provider slug as part of the model param.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants