Skip to main content

Token Factory: Quickstart

  1. Create an API key.
  2. Send a test request to the model.

1. Create an API key

  1. Top up the balance.
  2. In the control panel, in the top menu, click Products and select Token Factory.
  3. In the Token Factory section, click Create API key.
  4. Enter the key name or click Generate.
  5. Select the key validity period.
  6. Click Create. The API key can only be viewed once after creation — copy and save it.

2. Send a test request to the model

  1. Open the CLI.

  2. Send a test request:

    curl https://api.tf.selcloud.ru/v1/chat/completions \
    -H "Authorization: Bearer <api_key>" \
    -H "Content-Type: application/json" \
    -d '{
    "model": "<model_id>",
    "messages": [
    {
    "role": "developer",
    "content": "You are a helpful assistant."
    },
    {
    "role": "user",
    "content": "Hello!"
    }
    ]
    }'

    Specify:

    • <api_key> — API key that you created in step 1.

    • <model_id> — model ID, can be copied in the control panel: in the top menu, click Products → Token Factory → Model Catalog tab → in the model card, click next to the model name.