Set the OpenAI-compatible API base URL
The OpenAI-compatible API base URL depends on how you access Poolside. The examples on this page use the base URL for Poolside Platform.
OpenRouter uses an OpenAI-compatible API, so the same request shape and OpenAI SDK examples work when you switch the base URL and API key to OpenRouter.
For self-managed Poolside model inference, you can use LiteLLM as an OpenAI-compatible provider gateway in front of model-server
/v1 endpoints. See Use LiteLLM with Poolside model inference.
The Poolside Platform API is served at
/v1. A Poolside deployment serves the OpenAI-compatible API at /openai/v1. When you switch between them, update the path as well as the host.Authenticate API requests
Authenticate API requests with an API key sent as a Bearer token.Get and set your API key
Where you get your API key depends on how you access Poolside.- Poolside Platform: Use this for the fastest way to get a free developer API key for models hosted by Poolside. Go to platform.poolside.ai, sign in, open the API Keys tab, and click New key.
- OpenRouter: Use this if you already use OpenRouter or need paid access to Poolside models. Go to OpenRouter API keys, sign in, and create an API key.
- Poolside deployment: Use the API key or token from your Poolside administrator.
- OpenAI-compatible provider: Use the API key from the provider you configure.
os.environ in Python, process.env in TypeScript, and $POOLSIDE_API_KEY in shell.
Send the key with Bearer authentication
Send your API key in theAuthorization header:
Make your first request
Choose the approach that fits your setup. Each approach sends the same request, so you only need one.Direct HTTP request
Send a Chat Completions request. To find model IDs for your access method, see List available models.To send the same request through OpenRouter, use
https://openrouter.ai/api/v1/chat/completions as the URL and your OPENROUTER_API_KEY.OpenAI SDK
Install the OpenAI client library.To use OpenRouter instead, set the base URL to
https://openrouter.ai/api/v1 and pass your OPENROUTER_API_KEY.OpenRouter SDK
Install the OpenRouter client library.OPENROUTER_API_KEY.
Use the API for CLI automation
For CLI automation, setPOOLSIDE_API_KEY before running pool exec. If you also set POOLSIDE_API_URL, use the Poolside deployment API URL from your administrator, not the /openai/v1 OpenAI-compatible API path. See Automate tasks.
Next steps
- OpenAI-compatible API examples for endpoint reference, extra context, and tool use
- Supported models for model guidance, context windows, and modes
- Editors to use Poolside from editors and editor extensions
- Desktop apps to use Poolside from desktop apps