Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex AI Studio
  • About Yandex AI Studio
  • Getting started with Model Gallery
    • Overview of AI agents
    • Voice agents
    • Text-based agents
    • Conversations API
  • Yandex Workflows
  • Switching from the AI Assistant API to Responses API
  • Compatibility with OpenAI
  • Quotas and limits
  • Pricing policy
  • Access management
  • Audit Trails events
  • Public materials
  • Release notes
  • Terms and definitions
  1. Agent Atelier
  2. Conversations API

Conversations API

Written by
Yandex Cloud
Updated at February 18, 2026

To manage context when using with the Responses API, you can join responses, provide message history with each request, or use the Conversations API to store a conversation as a long-lived object with a stable ID.

The Conversations API recreates the conversation state using saved elements, such as:

  • user and assistant messages.
  • tool calls (tool calls).
  • other service messages.

Currently, you cannot edit elements or reset a conversation. To reload a conversation, create the new conversation object.

ExampleExample

In a multi-step conversation, the conversation object is provided to subsequent requests to preserve the state and share the context across responses:

import openai

YANDEX_CLOUD_FOLDER = "<folder_ID>"
YANDEX_CLOUD_API_KEY = "<API_key>"
YANDEX_CLOUD_MODEL = "yandexgpt"

client = openai.OpenAI(
    api_key=YANDEX_CLOUD_API_KEY,
    base_url="https://ai.api.cloud.yandex.net/v1",
    project=YANDEX_CLOUD_FOLDER
)

# Creating a conversation
conv = client.conversations.create()

# First message with a system instruction and custom input
r1 = client.responses.create(
    model=f"gpt://{YANDEX_CLOUD_FOLDER}/{YANDEX_CLOUD_MODEL}",
    conversation=conv.id,
    input=[
        {"role": "system", "content": "You are my assistant"},
        {"role": "user", "content": "Hi! Remember: My name is Anastasia."}
    ]
)
print("assistant:", r1.output_text)

# Continue in the same conversation
r2 = client.responses.create(
    model=f"gpt://{YANDEX_CLOUD_FOLDER}/{YANDEX_CLOUD_MODEL}",
    conversation=conv.id,
    input="What is my name?"
)
print("assistant:", r2.output_text)

Was the article helpful?

Previous
Text-based agents
Next
AI Search overview
© 2026 Direct Cursus Technology L.L.C.