Learn how to use OpenAI SDK with Keywords AI LLM proxy.
Keywords AI provides a robust and flexible LLM proxy with 250+ LLMs. You can use Keywords AI with OpenAI SDK by just passing the base_url
and api_key
to the OpenAI SDK.
With this integration, your LLM request will go through the Keywords AI gateway, and the requests will be automatically logged to Keywords AI.
We support all the OpenAI parameters. You can pass them directly in the request body.
You can pass Keywords AI parameters in the extra_body
parameter.
Keywords AI parameters can be passed differently depending on your programming language:
You can pass Keywords AI parameters in the extra_body
parameter.
These parameters will take precedence over the OpenAI parameters if they are conflicting.
To call Azure OpenAI models, instead of using azure OpenAI’s client, the easier way is to use the OpenAI client.
Then You can upload your Azure credentials to Keywords AI platform to use those models. Check out our Providers integration.