Getting Started
Go from a new account to your first request in about five minutes. Keep the Divyam console open alongside this page.
1. Sign up or sign in
- Open the console. Choose Sign up for a new account or Sign in for an existing one.
- To sign up, enter your name and work email, accept the terms, and select Create account. To sign in, enter your email and select Send me a code.
- Enter the six-digit code from your email and select Verify and continue. If the code expires, select Resend code.
The email code only signs you into the console. Your application uses an API key instead.
2. Create an API key
- In Getting Started, under Create an API key, select Issue a key.
- Enter a Key name that identifies the application, such as
customer-app-test, and select Create key. - Select Copy key and store the key in your application's secret settings.
- Check I understand this key will not be shown again, then select Done.
Divyam shows the full key only once, when you create it. If you lose it, create a new key and revoke the old one. See API keys.
Shortcut: do step 3 with an AI agent
Have your API key from step 2 ready, then paste this into Claude Code, Codex or another coding agent. It saves your key, sends the first request, and confirms it worked.
Save my Divyam API key and send a test request using https://docs.divyam.ai/divyam-setup.md
Your key never goes in the chat. The agent asks for it in a private prompt and saves it here, so later setups reuse it:
| System | Where the key is saved |
|---|---|
| macOS | Login Keychain |
| Linux with a desktop keyring | The desktop keyring |
| Linux without a keyring | A file only your user can read |
| Windows | A file encrypted for your Windows user account |
Setting up an application also saves the key in that application's own settings.
When it's done, continue with step 4.
3. Send your first request
Copy the Base URL shown under your key, and choose a model under Connect your application. The examples below use base URL https://api.preview.divyam.ai/v1 and model divyam-as/gpt-6-sol.
The model you choose in the console only changes the example. Your application sends its own model value with every request.
Put your key in an environment variable. In Bash, run this, paste the key at the prompt, and press Enter:
read -rsp 'Divyam API key: ' DIVYAM_API_KEY; printf '\n'; export DIVYAM_API_KEY
Then send a request from the same terminal:
- Python
- Node.js
- curl
Install the SDK with python3 -m pip install openai (Python 3.10 or later). Save this as first_request.py and run python3 first_request.py:
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["DIVYAM_API_KEY"],
base_url="https://api.preview.divyam.ai/v1",
)
response = client.chat.completions.create(
model="divyam-as/gpt-6-sol",
messages=[{"role": "user", "content": "Say hello in one sentence."}],
)
print(response.choices[0].message.content)
Install the SDK with npm install openai (Node.js 22 or later). Save this as first-request.mjs and run node first-request.mjs:
import OpenAI from 'openai'
const client = new OpenAI({
apiKey: process.env.DIVYAM_API_KEY,
baseURL: 'https://api.preview.divyam.ai/v1',
})
const response = await client.chat.completions.create({
model: 'divyam-as/gpt-6-sol',
messages: [{ role: 'user', content: 'Say hello in one sentence.' }],
})
console.log(response.choices[0].message.content)
curl --silent --show-error --include \
https://api.preview.divyam.ai/v1/chat/completions \
-H "Authorization: Bearer ${DIVYAM_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{
"model": "divyam-as/gpt-6-sol",
"messages": [{"role": "user", "content": "Say hello in one sentence."}]
}'
Look for HTTP 200 and the answer in choices[0].message.content.
You should see a one-sentence answer. An SDK takes the base URL, and a direct HTTP request needs the full /chat/completions URL. If you get an error, see Troubleshooting.
For more on each language, including connecting your own application, see Code examples.
4. Find the request in Logs
Open Logs in the console. Your request appears within a minute, newest first, with its status, token counts and latency. Select View request or View response to read the content. See Logs and usage for filters and details.
5. Check Usage and Credits
Open Usage to see requests, tokens, success rate and spend for the period, and Credits & Billing to see your remaining credit. Both catch up within a few minutes of a request. See Logs and usage and Credits and billing.
To connect a real application, pick a guide under Integrations.
Find your way
| Console page | What it's for | Docs |
|---|---|---|
| Getting Started | Create a key and prepare your first request. | Getting Started |
| API Keys | Create, rename, rotate and revoke keys. | API keys |
| Models & Pricing | Choose a model and see its rates. | Models and pricing |
| Logs | Find single requests, their status, tokens and content. | Logs and usage |
| Usage | Review requests, tokens, spend and routing over time. | Logs and usage |
| Credits & Billing | Check granted, spent and remaining credit. | Credits and billing |
| Alerts | Get emailed when credit is low or daily spend is high. | Alerts |