base_url and API key.
Migrate from OpenAI to AirCloud
If your application already uses the OpenAI SDK, you only need to replace two settings. See the OpenAI Compatible API page for the full quick start and code samples.Migration Checklist
- Replace
base_url/baseURLwith your AirCloud endpoint from the Console. - Replace your OpenAI API key with an AirCloud secret key.
- Update the
modelparameter to an AirCloud model ID.
Find Your Endpoint and Secret Key
Select your API workload in the Console, then click View Code to view the endpoint URL and code samples for the selected model.
YOUR_ENDPOINT and YOUR_API_KEY in the sample code with the values from your Console.
Authentication
Include your secret key in theAuthorization header for every API request.
Code Examples
For chat completion and embedding examples, see the OpenAI Compatible API page. Air API also supports text-to-speech through the OpenAI SDK’s audio endpoint, shown below.TTS Models
Best Practices
- Protect your API key — Store your secret key as an environment variable and never commit it to a source repository.
- Monitor usage — Regularly review API usage and costs in the Usage tab of the Console.
- Maintain available credits — API requests stop when your credits are exhausted. We recommend enabling automatic top-up to avoid service interruptions.
Related Documentation
Models and Playground
Learn how to select models and test them using the Playground.
OpenAI Compatible API
Connect your existing OpenAI SDK code to Air API in two lines.
Troubleshooting
Find solutions to common issues and errors.
API Reference
Explore detailed API specifications, including endpoints and parameters.

