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:- Sign in to your workspace at app.baseten.co, or create an account, and open API keys under Organization settings.
- Choose Create API key. For Name, enter
quickstart. - Select Personal. For Expiration, choose the shortest duration available, such as 7 days.
- Choose Create API key and copy the key. Baseten shows it only once.
YOUR_API_KEY with your key and run:
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. Themodel field selects the hosted model, GLM 5.3 in this example, and messages contains your input.
- Python
- JavaScript
- cURL
You’ll need uv to run this example.Save this code as Run it.
chat.py:chat.py
--with openai installs the SDK for this run:quickstart key.
Next steps
- Choose another Model API and replace the
modelvalue with its slug. - Stream the response to display text as the model generates it.
- Deploy from Explore if you need a model on dedicated GPUs with your own scaling settings.