YandexGPT API without code: a template that answers with AI text

A YandexGPT API without code takes one ready-made nana800 template: a webhook receives the request, YandexGPT writes the text, and a response block sends it back in the same request. You do not need a Yandex Cloud key or account, because nana800 connects to Yandex on its own. Your balance is topped up to $3.50 for free every month, and no card is needed to start.

Build it in the builder
The YandexGPT over API (Ask GPT request) template scheme in the nana800 builder

Chain of blocks

  1. 1

    Trigger

    button starts the scheme by hand for testing: YandexGPT gets the prompt from the template, and the answer shows up in the run history of the scheme. The button is free.

  2. 2

    Trigger · Webhook (trigger)

    webhook receives a request at the scheme address. The template uses the GET method and the "/" path, which you change to your own. The request body, the parameters after ? and the headers go to the next block.

  3. 3

    Action · YandexGPT text

    Yandex GPT text request sends the prompt to YandexGPT. The template has a sample prompt about five travel destinations, creativity 0.5 and the MEDIUM answer length. You add the system instruction and the request data.

  4. 4

    Action · Webhook response

    webhook response answers the sender with code 200 and plain text: the word "Response:" followed by the AI answer.

What it is good for

  • Product descriptions for a website or catalog: the site sends a name and specs and gets back a finished text
  • Answers to common customer questions in a website chat or a mobile app
  • Sorting incoming requests: the model picks the topic or pulls the name, phone number and essence out of the text
  • A short summary of a long email, review or document for a CRM or an accounting system
  • Connecting YandexGPT to your own software that can send HTTP requests, without dealing with Yandex Cloud

How to set it up

  1. 1

    Create a scheme from the template

    In the builder open Templates, find the Ask GPT request template and click Use. Choose the project and scheme to create it in, then click Create. The blocks arrive already connected.

  2. 2

    Set up the webhook address

    In the webhook block pick the method: GET if the text comes in the address after ?, or POST if it comes in a JSON request body. Enter your own path starting with "/", for example /ask.

  3. 3

    Write the prompt for YandexGPT

    In the Yandex GPT text request block describe the role and rules in the system context prompt field, for example: "You write short product descriptions for an online store". In user prompt replace the sample with your task and insert a field from the request, such as text from the body or from the address parameters.

  4. 4

    Turn the scheme on and test it with the button

    Turn the scheme on, then press the button in the button trigger and open the run history: the finished text is in result_text of the YandexGPT block. A button run has no request data, so for the first test write a sample right into the prompt. The webhook response block shows an error on such a run because nobody waits for the answer, which is expected.

  5. 5

    Send a request over the API

    Click the API button in the builder and copy the webhook address. Send a test request on the Try it tab: the AI answer comes back in the response body. While the scheme is on, it costs $0.0042 per hour.

Services in this template

  • Webhook

    Receive website leads and service events with a webhook and answer requests with no server and no code. Free balance every month, no card needed.

  • YandexGPT and YandexART

    Use YandexGPT without code for posts, customer replies and daily digests, and YandexART for images. No Yandex Cloud key needed, free balance every month.

Frequently asked questions

Receiving a request with the webhook costs one basic block run, 1,000 runs cost $1, and the answer to the sender is free. A YandexGPT block run costs more because it includes the work of the Yandex model, and the exact price is on the YandexGPT page. An enabled scheme costs $0.0042 per hour. Your balance is topped up to $3.50 for free every month, no card needed. A scheme kept on around the clock for a month spends most of that on scheme hours.

No. The Yandex GPT text request block works through the Yandex Cloud account of nana800, so you do not sign up with Yandex or paste any keys. Every run is paid from your nana800 balance, and Yandex does not bill you separately.

With GET the text goes in the address after ?, for example ?text=..., and you insert the text field from the request parameters (query) into the prompt. With POST you send JSON like {"text": "..."} and insert the text field from the request body (body). The method is chosen in the webhook block.

Until YandexGPT finishes the text and the scheme reaches the webhook response block. If the scheme runs longer than 120 seconds, nana800 answers with code 200 and {"finished":true,"default":true} without the AI text. So avoid long pauses in a scheme that answers over the API.

Yes, but not by inserting the text directly. The AI text is inserted as is, and quotes or line breaks inside it break JSON, so the template sends the text in the body raw field. For JSON, add the free run custom script block before the answer to return an object with the text, and insert its result into body json.

Anyone who knows the address: webhooks are public, and every request spends balance on a YandexGPT run. An address called from page code in the browser is visible to every visitor. To protect it, ask the sender to add a secret header and compare it with the condition block, or check a token with the validate jwt block.

Build your first scheme for free

Sign-up is free and needs no card. Every month the balance is topped up to $3.50 for free, enough for about 3,500 runs of basic blocks.

Build it in the builder