Skip to main content
Call a shared Model API endpoint. Baseten hosts the model and manages the infrastructure; you send requests without deploying a model. You pay for the input and output tokens your requests use. See pricing and limits.
To have your coding agent run this quickstart, see Run a quickstart with your agent.

Create an API key

Use a personal API key to authenticate your requests. Reuse a saved key or create one:
  1. Open API keys and sign in. If you don’t have an account, create one first.
  2. Select Create API key and enter a name such as quickstart.
  3. Select Personal, then Create API key.
  4. Copy the key. Baseten only shows it once.
In your terminal, replace YOUR_API_KEY with your key and run:
Run the examples from this terminal so they can read BASETEN_API_KEY. Keep the key out of source code and version control.

Send a request

Call the Chat Completions API with Python, JavaScript, or cURL. The SDK examples use Baseten’s base URL and API key; you don’t need an OpenAI account. The model field selects the hosted model, GLM 5.3 in this example, and messages contains your input.
You’ll need uv to run this example.Save this code as chat.py:
chat.py
Run it. --with openai installs the SDK for this run:
The exact wording varies. Change the message and run the request again.

Next steps