Skip to content
On this page

Getting Started with Authentication

To connect with Gigachat, you need to generate an API token. This token will serve as your key to access Gigachat's services through API calls. Follow the steps below to get your token:

Step 1: Generate an API Token

  1. Open your browser and visit the Gigachat dashboard.
  2. Once you're on the page, find and click the menu item labeled "API Keys". You'll find this on the top navigation bar.
  3. You'll need to give your key a name. Think of a name that will help you remember what this key is used for, then enter it in the appropriate field. Once done, click the Create Token button.

Congrats! You now have your own API token for Gigachat.

Step 2: Using the API Token in Requests

Having your token allows you to authenticate and make requests to the API. You use this token by including it in the headers of your API request.

Here's an example: Let's say you want to retrieve information about all chatbots. You would make an API request like the one below:

shell
curl 'https://api.gigachat.ai/chatbots' \
  -H 'Authorization: Bearer {API_token}'

In the example above, replace {API_token} with the token you generated in Step 1. This tells Gigachat that you have the rights to access the information and makes the service return the chatbot data to you.

That's it! You now know how to authenticate and make API requests to Gigachat using your API token. Happy coding!