AI Assistant Development Based on GigaChat (Sber) for Mobile App

TRUETECH is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
AI Assistant Development Based on GigaChat (Sber) for Mobile App
Medium
~3-5 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1054
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

Building an AI Assistant with GigaChat (Sber) in a Mobile Application

GigaChat is Sber's language model with an API specifically oriented toward B2B applications with data processing in Russia's secure perimeter. For financial, medical, and government applications where storing data abroad is legally impossible, GigaChat becomes the primary option alongside YandexGPT.

Authentication: OAuth 2.0 with Client Credentials

GigaChat API requires OAuth 2.0. Flow: obtain access_token via POST https://ngw.devices.sberbank.ru:9443/api/v2/oauth with Authorization: Basic {base64(client_id:client_secret)} and scope (GIGACHAT_API_PERS for individuals, GIGACHAT_API_CORP for organizations).

Token lives for 30 minutes. You cannot store it on the mobile client or obtain it directly—client_id and client_secret must only be on the server. Server proxy for GigaChat is a mandatory component, not optional.

# Server side (Python) — obtaining token
import httpx, base64, time

class GigaChatAuth:
    def __init__(self, client_id: str, client_secret: str):
        self._credentials = base64.b64encode(
            f"{client_id}:{client_secret}".encode()
        ).decode()
        self._token = None
        self._expires_at = 0

    async def get_token(self) -> str:
        if time.time() < self._expires_at - 60:
            return self._token
        async with httpx.AsyncClient(verify=False) as client:  # Sber uses custom CA
            resp = await client.post(
                "https://ngw.devices.sberbank.ru:9443/api/v2/oauth",
                headers={"Authorization": f"Basic {self._credentials}"},
                data={"scope": "GIGACHAT_API_CORP"}
            )
        data = resp.json()
        self._token = data["access_token"]
        self._expires_at = data["expires_at"] / 1000  # ms -> s
        return self._token

Note: verify=False in Python httpx—Sber uses root certificates from the Russian state registry that are not in the system trusted store of most OSes. For production, add Russian root CAs explicitly.

GigaChat API: Chat Completions

After obtaining the token—standard POST /api/v1/chat/completions:

{
  "model": "GigaChat",
  "messages": [
    {"role": "system", "content": "You are a financial analyst assistant."},
    {"role": "user", "content": "Explain the P/E ratio"}
  ],
  "stream": true,
  "temperature": 0.7,
  "max_tokens": 1024
}

Available models: GigaChat (base), GigaChat-Plus, GigaChat-Pro. Differences are in response quality and speed, similar to Lite/Pro in Yandex.

Streaming is via SSE, format compatible with OpenAI: data: {...} with delta.content. This is convenient: if you already have an OpenAI-compatible SSE parser, it works with GigaChat without changes.

Function Calling

GigaChat supports function calling via the functions parameter in the request. The syntax differs from OpenAI: the field is called functions (not tools), and the call comes in function_call (not tool_calls). When migrating from OpenAI, this is the first place where code breaks.

{
  "functions": [{
    "name": "get_account_balance",
    "description": "Get customer account balance",
    "parameters": {
      "type": "object",
      "properties": {
        "account_id": {"type": "string"}
      },
      "required": ["account_id"]
    }
  }],
  "function_call": "auto"
}

Working with Images

GigaChat Pro supports passing images via file_id. Upload the file first via POST /api/v1/files with purpose: general, receive id, then use in message:

{
  "role": "user",
  "content": [
    {"type": "text", "text": "What is in this document?"},
    {"type": "image_url", "image_url": {"url": "https://gigachat.ru/files/{file_id}/content"}}
  ]
}

File is deleted automatically after 24 hours.

Timeline Estimates

Server proxy with OAuth + basic text assistant—1.5–2 weeks (accounting for root certificate setup and OAuth testing). With function calling and images—3–4 weeks.