IN ENGLISH · VS CODE AND JETBRAINS CODING ASSISTANT

Connect Continue to an AI API from Iran: the complete guide

Continue is an open-source coding assistant for VS Code and JetBrains, and its configuration is one simple file: config.yaml. Each model is a block, and the apiBase field is where 1xAi's address goes; you can define several models from several vendors side by side, all working with one key billed in Toman.

[01]STEPS

Setting up Continue

  1. [01]

    Create an account and a 1xAi key. Register at 1xai.ir (the app is in Persian) and confirm your email or mobile number. You spin the sign-up gift wheel (from 100,000 to 1,000,000 Toman of gift credit) once, which is enough to test the connection. Then create a 1xai-* key in the dashboard and copy it at once: a key is shown only once.

  2. [02]

    Install the Continue extension. Install Continue from the VS Code or JetBrains marketplace and open its panel.

  3. [03]

    Open config.yaml. Open the configuration file from the settings icon in the Continue panel, or edit ~/.continue/config.yaml directly.

  4. [04]

    Add a models block with apiBase. Add a block for each model: provider openai, model the exact model name, apiBase https://1xai.ir/v1 and apiKey the 1xai-* key.

  5. [05]

    Save and choose a model. Save the file; Continue picks the change up (reload the window if needed). Now pick the model from the selector at the foot of the chat panel and send a first message.

[02]CONFIGURATION

Ready to copy

~/.continue/config.yamlyaml
models:
  - name: Claude Sonnet via 1xAi
    provider: openai
    model: claude-sonnet-4-6
    apiBase: https://1xai.ir/v1
    apiKey: 1xai-XXXXXXXXXXXXXXXX
    roles:
      - chat
      - edit

  - name: GPT-4o mini via 1xAi
    provider: openai
    model: gpt-4o-mini
    apiBase: https://1xai.ir/v1
    apiKey: 1xai-XXXXXXXXXXXXXXXX
    roles:
      - chat
[03]MODEL

Recommended model

Recommended: claude-sonnet-4-6. A cheaper alternative: gpt-4o-mini. Use a strong model for the chat and edit roles; for lighter roles and quick questions the alternative is defined beside it in the same config and is one click away. Every model and its Toman price is on the models page.

[04]TROUBLESHOOTING

Common errors

Changes to the config do not apply
YAML is sensitive to indentation: keep the spaces exactly as in the sample and do not use tabs. After saving, if the new model does not appear in the selector, reload the editor window once.
401: invalid key
The key is wrong, has expired, or you revoked it. Copy it again from the dashboard or create a new one, with no space before or after it.
402: insufficient balance
The account's Toman credit is used up. A top-up starts at 100,000 Toman, by the Zarinpal gateway or the Digipay gateway or card-to-card transfer with a receipt; calls work again as soon as a payment succeeds.
Model name or routing error
1xAi routes by model name: claude-* to Anthropic, gemini-* to Google, deepseek-* to DeepSeek; grok-*, kimi-*, glm-*, qwen*, MiniMax-* and hy* reach the Grok, Kimi, GLM, Qwen, MiniMax and Hunyuan models; every other name goes to OpenAI. Write a model id exactly as the model list shows it.

Every error code is in the error reference.

FAQ · IN ENGLISH

I have config.json, not config.yaml. What now?

Newer versions of Continue use config.yaml; in older versions the same fields (provider, model, apiBase, apiKey) are defined in config.json as JSON. The idea is the same: provider openai, and apiBase 1xAi's address.

Why is provider openai when the model is Claude?

In Continue the provider field states only the call protocol, not the model's maker. 1xAi speaks the OpenAI-compatible protocol and routes by model name: claude-* goes to Anthropic and gemini-* to Google; the key and the bill are the same.

Other guides: Cursor, Claude Code, n8n, Cline, Open WebUI, LibreChat.

1xAi is an independent gateway. It is not affiliated with, endorsed by, or a reseller for OpenAI, Anthropic, Google, DeepSeek, xAI, Moonshot AI, Z.ai, Alibaba Qwen, MiniMax or Tencent Hunyuan. Requests are relayed upstream rather than answered by models of our own, so each provider's own usage policies apply to what their models will and will not do, and their model availability is theirs to change. Current reachability is published on the status page.