Yandex AI Studio serves YandexGPT and other models at https://llm.api.cloud.yandex.net, both through its native API and an OpenAI-compatible one at /v1. Models are addressed as gpt://<folder_id>/<model>/latest.
Create a service account API key in the Yandex Cloud console and send it as Authorization: Api-Key <key>. In the examples it's written {{YANDEX_API_KEY}}; {{FOLDER_ID}} is your cloud folder id.
Full reference: https://aistudio.yandex.ru/docs/en/ai-studio/api/
curl -X POST https://llm.api.cloud.yandex.net/foundationModels/v1/completion \
-H "Authorization: Api-Key {{YANDEX_API_KEY}}" \
-H "Content-Type: application/json" \
-d '{"modelUri": "gpt://{{FOLDER_ID}}/yandexgpt/latest", "completionOptions": {"maxTokens": 500, "temperature": 0.3}, "messages": [{"role": "user", "text": "Привет! Расскажи про API."}]}'
curl -X POST https://llm.api.cloud.yandex.net/v1/chat/completions \
-H "Authorization: Api-Key {{YANDEX_API_KEY}}" \
-H "Content-Type: application/json" \
-d '{"model": "gpt://{{FOLDER_ID}}/yandexgpt/latest", "messages": [{"role": "user", "content": "Hello!"}]}'