docs: clarify Realtime API createHeaders examples and correct authentication usage#759
Open
naresh4dev wants to merge 1 commit intoPortkey-AI:mainfrom
Open
Conversation
Contributor
siddharthsambharia-portkey
left a comment
There was a problem hiding this comment.
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.
Collaborator
vrushankportkey
left a comment
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
createHeadersexamples 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 callsapi_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.createHeaders(provider, apiKey)rather than incorrectly passing OpenAI API key into the client’sapi_keyproperty when routing through Portkey.