Skip to content

Quick Start

This guide shows you how to send your first request to the SynStar AI API.

SynStar AI provides an OpenAI-compatible API gateway. If you have used the OpenAI SDK or OpenAI-style API requests before, you can usually start by changing only the base_url, api_key, and model.


1. Get Your API Key

Log in to the SynStar AI dashboard and select Token Management from the left sidebar.

Click Create token to create a new API key.

In the token creation panel, fill in the basic information:

  • Name: Enter a clear name for this API key, such as testing, production-backend, or demo-app.

  • Token Group: Select the Token Group for this API key. The Token Group determines the billing rate applied to model usage. SynStar AI will automatically settle usage at the corresponding rate, such as 0.3×, 0.5×, or 0.7× of the listed model price, depending on the selected group.

  • Expiration time: Choose an expiration time based on your use case. For long-term use, you can select Never expires.

  • Quota settings: You can enable Unlimited quota, or set a custom quota amount to limit how much this token can consume.

  • Access restrictions: If you do not need special model restrictions, IP whitelist, RPM limits, or TPM limits, you can keep the default settings.

After confirming the settings, click Submit.

Once the token is created, you will receive your API key. Copy and store it securely. You will use this key to authenticate your API requests.

Your API key will look similar to:

text
sk-xxxxxxxxxxxxxxxx

Note: Token Groups are related to billing. The group you select determines the billing rate used for API usage settlement. Top-up credits are added to your account balance, while Token Groups control how credits are deducted when models are used. For more details, see Pricing Overview.

Keep your API key secure. Do not expose it in frontend code, public repositories, browser screenshots, or client-side applications.

> Keep your API key secure. Do not expose it in frontend code, public repositories, browser screenshots, or client-side applications.

## 2. Configure the Base URL

SynStar AI supports OpenAI-compatible API requests through the following endpoint formats.

Different SDKs, plugins, or API testing tools may require the base URL in different formats. Use the format that matches your integration method.

```text
https://www.kkiai.com
https://www.kkiai.com/v1
https://www.kkiai.com/v1/chat/completions

For most OpenAI SDK integrations, use:

text
https://www.kkiai.com/v1

For direct HTTP requests to the chat completions API, use the full endpoint:

text
https://www.kkiai.com/v1/chat/completions

If your tool separates the Base URL and the endpoint path, make sure you do not duplicate /v1.

For example:

text
Base URL: https://www.kkiai.com/v1
Endpoint path: /chat/completions

Do not use:

text
https://www.kkiai.com/v1/v1/chat/completions

If your dashboard provides a different endpoint, use the base URL shown in your account.

3. Choose a Model

Before sending a request, choose a model ID from the supported model list.

You can find available model IDs in the Model Marketplace or the Supported Models list. Use the model name exactly as shown in the first column.

For example:

text
gpt-4o
claude-opus-4-7
gemini-2.5-pro
deepseek-chat

In the request body, set the selected model as the value of model:

json
{
  "model": "gpt-4o"
}

If you are not sure which model to use, start with a commonly used chat model first, then switch models later based on your use case, cost, speed, and output quality.


4. Send Your First Request

You can paste the command below into your terminal to send your first API request.

Replace YOUR_API_KEY with your SynStar AI API key.

bash
curl https://www.kkiai.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "gpt-4o",
    "messages": [
      {
        "role": "user",
        "content": "Say this is a test!"
      }
    ],
    "temperature": 0.7
  }'

This request sends a simple user message to the selected model and returns a chat completion response.


5. Check the Response

A successful response will look similar to this:

json
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1677858242,
  "model": "gpt-4o",
  "usage": {
    "prompt_tokens": 13,
    "completion_tokens": 7,
    "total_tokens": 20
  },
  "choices": [
    {
      "message": {
        "role": "assistant",
        "content": "This is a test!"
      },
      "finish_reason": "stop",
      "index": 0
    }
  ]
}

If you receive a response with a choices field, your request was successful.

The message.content field contains the model output.

The finish_reason field shows why the model stopped generating. For example, stop means the response was completed normally.


6. Test Your Configuration

You can verify your API configuration in two ways:

  1. Test the request in the SynStar AI chat or playground page.
  2. Use an API testing tool such as Postman, Apifox, or another HTTP client.

A typical configuration looks like this:

json
{
  "base_url": "https://www.kkiai.com/v1",
  "api_key": "YOUR_API_KEY",
  "model": "gpt-4o"
}

If your request fails, check the following:

  • The API key is correct.
  • The Authorization header uses the Bearer format.
  • The base URL is correct.
  • The model ID is available in your account.
  • Your account has enough balance or trial credits.

For more details about request authentication, see Authentication.

For browser-based testing, see Online API Testing.