Getting Started
Send your first API request
Create an API key, install the SDK, and send a chat completion request.
- Install the Python or TypeScript SDK
- Send a request to a SAGEA model
- Print the model's response
Everything here is the foundation for the agent and document quickstarts that follow.
Time to complete: ~5 minutes
Prerequisites
- Python 3.9+ or Node.js 18+ installed on your machine.
- A SAGEA account. Create account
- A SAGEA API key. Foundry is enabled in Free mode by default, with no credit card required.
Step 1: Get your API key
- Open Foundry → API keys.
- Click Create new key.
- Give the key a name (for example,
quickstart) and click Create. - Copy the key to your clipboard. The key appears only once; if you lose it, generate a new one.
- Set the key as an environment variable in your terminal:
Step 2: Install the SDK
Step 3: Send your first request
Create a file and add the following code:
Step 4: Run it
Verify
The terminal prints a short description of SAGEA. If it doesn't, check the error table below.
| Error | Cause | Fix |
|---|---|---|
401 Unauthorized | API key is incorrect or not set | Run echo $SAGEA_API_KEY to confirm the variable is set |
429 Too Many Requests | Rate limit hit | Wait and retry with exponential backoff |
404 Not Found | Wrong base URL | Use https://api.sagea.space/v1 |
