Sending a request in prompt mode
Written by
Updated at October 28, 2025
Getting started
Python
Get API authentication credentials as described in Authentication with the Yandex AI Studio API.
Send a request to the model
Python
-
Create a file named
index.pyand add the following code to it:import openai YANDEX_CLOUD_MODEL = "yandexgpt-lite" client = openai.OpenAI( api_key=YANDEX_CLOUD_API_KEY, base_url="https://rest-assistant.api.cloud.yandex.net/v1", project= YANDEX_CLOUD_FOLDER ) response = client.responses.create( model=f"gpt://{YANDEX_CLOUD_FOLDER}/{YANDEX_CLOUD_MODEL}", input="Come up with three off-beat ideas for a travel startup.", temperature=0.8, max_output_tokens=1500 ) print(response.output[0].content[0].text) -
Save authentication data to environment variables:
export YANDEX_CLOUD_FOLDER=<folder_ID> export YANDEX_CLOUD_API_KEY=<API_key> -
Run the file you created:
python index.pyResponse example:
1. **Travel search and management platform with astrology factored in.** The service will help travelers choose a destination, trip dates, and activities based on their astrological sign or individual natal chart. This may include recommendations on the best periods for traveling, places that are in tune with your sign's energy, and the choice of cultural and natural attractions that align with your astrological preferences. 2. **Virtual travel guide with augmented reality features.** This is an app or service allowing users to "come across" a virtual guide wherever they are via augmented reality (AR). This guide can share facts if interest about the location, show hidden sightseeing attractions, and suggest routes for your hikes. The user can ask questions and get answers in real time with the AR technology responsible for visualization. 3. **AI-based travel management service.** A platform that relies on AI algorithms to personalize your travels. AI can analyze the user’s preferences, budget, season, etc., and propose optimized routes, including flights, transfers, accommodations, and activities. The service can also propose alternatives if there is a change of schedule or other unforeseen events.
See also
- Overview of Yandex AI Studio AI models
- Examples of working with ML SDK on GitHub