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

Create a personal API key for this quickstart. It carries your account’s permissions and expires on the date you set, which suits a short test on your own machine. To create an API key:
  1. Sign in to your workspace at app.baseten.co, or create an account, and open API keys under Organization settings.
  2. Choose Create API key. For Name, enter quickstart.
  3. Select Personal. For Expiration, choose the shortest duration available, such as 7 days.
  4. Choose Create API key and copy the key. Baseten shows it only 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. A personal API key works for these steps on your own machine. For applications, CI, and shared automation, use a team API key scoped to the models, environments, or Model APIs that workload needs.

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. When you finish testing, revoke the quickstart key.

Next steps