Make Your First API Call
This tutorial takes you from a model in Tenant Console to one authenticated request through the current Smart Studio gateway.

Before You Start
- Sign in to Tenant Console.
- Confirm that the account has credits or an active billing arrangement.
- Prepare a secret manager or local environment-variable store for the API key.
- Use a chat-capable model for the request below.
1. Choose and Test a Model
- Open Models and choose a chat-capable model.
- Copy its callable model ID exactly as displayed.
- Open Labs → Chat, send a small test prompt, and confirm that the model responds.
Testing in the Lab separates model-access problems from application-code problems.
2. Create an API Key
- Open Account → API Keys (in your deployed Console).
- Select Create New Key.
- Allow the selected model, then configure the limits and restrictions required by your application.
- Copy the key into your secret manager. It may not be shown again.
See API Keys for model allowlists, token limits, spending limits, IP restrictions, and expiration.
3. Configure the Current Environment
The gateway for this documentation environment is https://gateway.example.com/model-gateway.
export SMART_STUDIO_BASE_URL="https://your-environment-gateway"
export SMART_STUDIO_API_KEY="your-api-key"
export SMART_STUDIO_MODEL_ID="your-model-id"
Replace the Base URL with the value shown above. Do not commit these values or print the real key in logs.
4. Send the Request
curl "$SMART_STUDIO_BASE_URL/v1/chat/completions" \
-H "Authorization: Bearer $SMART_STUDIO_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"model\":\"$SMART_STUDIO_MODEL_ID\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello\"}]}"
A successful response contains an assistant message and request metadata. Continue to the complete Chat Completions contract before adding optional fields or production error handling.
Verify the Result
- Confirm that the response contains content from the selected model.
- Open History and locate the request.
- Open Usage and confirm that consumption appears.
- Record any trace identifier returned by the gateway before troubleshooting.
Troubleshooting
- Authentication failed: confirm the Bearer header and that the key is enabled and unexpired.
- Model unavailable: copy the exact model ID again and verify that the key allows it.
- Request rejected: check credits, billing, token limits, spending limits, and IP restrictions.
- Wrong endpoint: use Chat, Image, or Video API documentation that matches the model modality.
- No usage record: wait briefly, then use History and the trace identifier to locate the request.
Next Step
Open API Overview to choose Chat, Image, or Video integration guidance, or use the SDK Overview when you need the management CLI and clients.