Skip to main content

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.

Platform overview — 200+ models, 20+ providers, pricing information, and quickstart entry points

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 a Model​

  1. Open Models and choose a chat-capable model.
  2. Copy its callable model ID exactly as displayed.

2. Prepare an API Key​

  1. Open Account → API Keys (in your deployed Console).
  2. Reuse an enabled, unexpired key that allows the selected model, or select Create New Key if you do not have one.
  3. Allow the selected model, then configure the limits and restrictions required by your application.
  4. 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. Test the Model and Configure the Environment​

Open Labs → Chat with the valid API key, send a small test prompt, and confirm that the model responds. Lab calls require a key even before application integration.

Obtain the inference gateway origin from your deployment administrator, for example https://gateway.example.com. Use the gateway that serves /v1/chat/completions; a Console page URL is not the inference endpoint.

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 your verified gateway origin, without a trailing /v1. OpenAI SDK clients instead use this origin plus /v1 as their base_url or baseURL. 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​

  1. Confirm that the response contains content from the selected model.
  2. Open History and locate the request.
  3. Open Usage and confirm that consumption appears.
  4. 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.