> For the complete documentation index, see [llms.txt](https://docs.nocodecloud.ru/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nocodecloud.ru/ai/poluchenie-tokenov-gigachat.md).

# Получение токенов GigaChat

{% hint style="info" %}
В API Гигачата несколько сервисов, есть платные и бесплатные.

Самый дешевый сервис - Эмбеддинги - 400 рублей за 10 000 000 токенов

<img src="/files/y6ZmzO6Aj3SGk7AoAB8W" alt="" data-size="original">
{% endhint %}

### Пошаговая инструкция по получению токена API (он общий для сервисов)

1. Откройте сайт: <https://developers.sber.ru/portal/products/gigachat-api>

   <figure><img src="/files/dTVyvmFxgmdWhXJPQRvL" alt=""><figcaption></figcaption></figure>
2. Выберите “Личный кабинет“

   <figure><img src="/files/953BemdL47uXzf1dmb0W" alt=""><figcaption></figcaption></figure>
3. Войдите по Сбер ID или по телефону
   1. Если Сбер ID нет, регистрируйтесь по номеру телефона

      <figure><img src="/files/LuOIfjAziMJRwMHBpzZn" alt=""><figcaption></figcaption></figure>
4. После авторизации вы попадете в кабинет, который также называется Studio.

   <figure><img src="/files/0YmUKBjsWXywNkxPqsvL" alt=""><figcaption></figcaption></figure>
5. Создайте проект Gigachat API

   <figure><img src="/files/95HzPwcCEQyAjP5QJ851" alt=""><figcaption></figcaption></figure>
6. Нажмите кнопку “Получить доступ”

   <figure><img src="/files/HBsdPY6XRLMooZcnwDat" alt=""><figcaption></figcaption></figure>
7. Откроется раздел с настройкой API

   <figure><img src="/files/bF7AadDa9Ey7SC96IWAm" alt=""><figcaption></figcaption></figure>
8. Нажмите синюю кнопку “Получить ключ“

   <figure><img src="/files/S163eR81iUtspFy1YzK9" alt=""><figcaption></figcaption></figure>
9. Сохраните Authorization Key - это и есть токен
10. При запросах в API указывайте заголовок Authorization cо значением

    ```
    Bearer <Authorization Key>
    ```

    Например

    ```
    curl -X POST \
      https://api.sber.ru/gigachat/api/v1/embeddings \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
      -d '{
        "texts": ["Your text to embed goes here."],
        "model": "YOUR_EMBEDDING_MODEL_NAME"
      }'
    ```
11. В ответе вы можете получить ошибку, связанную с неоплаченным токеном
    1. Если токен платный, откройте биллинг

       <figure><img src="/files/4EXx7dfzCZNt70gPQDvY" alt=""><figcaption></figcaption></figure>
    2. Выберите нужный платный сервис, например, Эмбеддинги, и нажмите “Перейти к оплате“

       <figure><img src="/files/CMUNCJoo1hSDy6Rkq7LW" alt=""><figcaption></figcaption></figure>
    3. И оплачивайте удобным вам способом

       <figure><img src="/files/XKqlVE6i4XWhgRNh5ses" alt=""><figcaption></figcaption></figure>
12. После оплаты ваши запросы начнут обрабатываться


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.nocodecloud.ru/ai/poluchenie-tokenov-gigachat.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
