gigachat

Integrate GigaChat (Sber AI) with OpenClaw via gpt2giga proxy

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "gigachat" with this command: npx skills add smvlx/sber-gigachat

GigaChat Skill

Integrate GigaChat (Sber AI) with OpenClaw via gpt2giga proxy.

Features

  • Three models: GigaChat, GigaChat-Pro, GigaChat-Max
  • OpenAI API compatibility via gpt2giga proxy
  • Automatic token management (gpt2giga handles OAuth internally)
  • Credentials passed via environment variables only (never on CLI)

Prerequisites

  1. GigaChat API Access:

    • Register at https://developers.sber.ru/
    • Create a GigaChat API application
    • Note your Client ID and Client Secret
    • Choose scope: GIGACHAT_API_PERS (free tier) or GIGACHAT_API_CORP (paid)
  2. Python & gpt2giga:

    pip3 install gpt2giga
    
  3. Environment File: Create ~/.openclaw/gigachat-new.env:

    CLIENT_ID="your-client-id-here"
    CLIENT_SECRET="your-client-secret-here"
    
    # Auto-generate credentials (base64 of CLIENT_ID:CLIENT_SECRET)
    GIGACHAT_CREDENTIALS=$(echo -n "$CLIENT_ID:$CLIENT_SECRET" | base64)
    GIGACHAT_SCOPE="GIGACHAT_API_PERS"
    

Quick Start

1. Start the proxy

/openclaw/skills/gigachat/scripts/start-proxy.sh

Output:

Starting gpt2giga proxy on port 8443...
✅ gpt2giga started successfully (PID: 12345)
   Log: ~/.openclaw/gpt2giga.log
   Endpoint: http://localhost:8443/v1/chat/completions

gpt2giga handles OAuth token generation and refresh internally using the GIGACHAT_CREDENTIALS environment variable.

2. Configure OpenClaw

Run the patch script (backs up your config first):

/openclaw/skills/gigachat/scripts/patch-config.sh

Or add manually to openclaw.json:

{
  "models": {
    "providers": {
      "gigachat": {
        "baseUrl": "http://127.0.0.1:8443",
        "apiKey": "not-needed",
        "api": "openai-completions",
        "models": [
          {
            "id": "GigaChat-Max",
            "name": "GigaChat MAX",
            "contextWindow": 32768,
            "maxTokens": 8192
          },
          {
            "id": "GigaChat-Pro",
            "name": "GigaChat Pro",
            "contextWindow": 32768,
            "maxTokens": 4096
          },
          {
            "id": "GigaChat",
            "name": "GigaChat Lite",
            "contextWindow": 8192,
            "maxTokens": 2048
          }
        ]
      }
    }
  }
}

3. Test

curl -s -X POST http://localhost:8443/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "GigaChat-Max",
    "messages": [{"role": "user", "content": "Привет!"}]
  }' | jq -r '.choices[0].message.content'

Expected output:

Привет! Как дела?

Creating an Agent

Add a GigaChat-powered agent to openclaw.json:

{
  "agents": {
    "list": [
      {
        "id": "ruslan",
        "name": "Ruslan",
        "emoji": "🐻",
        "model": "gigachat/GigaChat-Pro",
        "workspace": "/root/.openclaw/agents/ruslan/workspace"
      }
    ]
  }
}

Create agent workspace:

mkdir -p /root/.openclaw/agents/ruslan/workspace

IDENTITY.md:

# IDENTITY.md

- Name: Ruslan
- Creature: Российский AI-ассистент
- Vibe: Дружелюбный, знает русский контекст
- Emoji: 🐻

SOUL.md:

# SOUL.md — Кто ты

Ты Руслан. Российский AI-ассистент на базе GigaChat.

Говоришь на русском, знаешь русский контекст (кухня, культура, реалии).
Отвечаешь кратко и по делу. Без лишней вежливости.

Token Management

gpt2giga handles OAuth token generation and refresh automatically using the GIGACHAT_CREDENTIALS environment variable. No manual token management is needed.

If the proxy loses its token (e.g. after a long idle period), restart it:

/openclaw/skills/gigachat/scripts/start-proxy.sh

Troubleshooting

Issue: 401 Unauthorized

Cause: Token expired or invalid credentials
Fix: Restart proxy script (generates fresh token)

Issue: 402 Payment Required

Cause: Quota exhausted for that model
Fix: Try a different model or wait for quota reset

  • Free tier: Limits per model
  • Strategy: Rotate between Max → Pro → Lite

Issue: Process defunct / zombie

Cause: gpt2giga crashes but holds port
Fix:

fuser -k 8443/tcp
/openclaw/skills/gigachat/scripts/start-proxy.sh

Architecture

OpenClaw → http://localhost:8443/v1/chat/completions
           ↓
       gpt2giga (proxy, env-var auth)
           ↓
   Sber GigaChat API (OAuth token auto-managed)

Flow:

  1. Startup script exports credentials as environment variables
  2. gpt2giga starts and handles OAuth token generation internally
  3. OpenClaw sends OpenAI-format requests to localhost:8443
  4. gpt2giga translates to GigaChat format and manages auth
  5. Responses translated back to OpenAI format

Files

  • scripts/start-proxy.sh — Start proxy with env-var credentials
  • scripts/start.sh — Alternative start (nohup)
  • scripts/stop.sh — Stop proxy
  • scripts/status.sh — Check proxy status
  • scripts/setup.sh — Install gpt2giga from PyPI
  • scripts/patch-config.sh — Add GigaChat provider to openclaw.json (backs up config first)
  • SKILL.md — This file

Limitations

  • Free Tier Quotas: Limited tokens per model
  • SSL Verification: Disabled by default due to Sber's custom CA; install Sber root CA to /etc/ssl/certs/sber-ca.crt to enable
  • Credentials: Passed via environment variables only (never on the command line); protect ~/.openclaw/gigachat-new.env with chmod 600

References

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Img2img

Generate images from text descriptions using DALL-E 3 while adhering to usage policies and avoiding realistic human faces.

Registry SourceRecently Updated
General

Habitat-GS-Navigator

Navigate and interact with photo-realistic 3DGS environments via the Habitat-GS Bridge. Use when: user asks to explore a 3D scene, perform embodied navigatio...

Registry SourceRecently Updated
General

Memory Palace

持久化记忆管理。Use when: 用户告诉你个人信息/偏好/习惯、需要记住项目状态/技术决策、完成任务后有可复用经验、用户说"记住""别忘了""下次注意"、需要回忆之前的对话内容。支持语义搜索和时间推理。

Registry SourceRecently Updated
General

Podcast Transcript Mining Authority Positioning

Extract guest appearances, speaking topics, and soundbites from podcast transcripts to build authority portfolios and generate podcast pitch templates. Use w...

Registry SourceRecently Updated