Tutorials

Coding tutorials

Use this API in coding CLIs, IDE extensions and agents · 4 lessons

1Claude Code

Point Claude Code at this site with environment variables

  1. Create a token under Console → API Tokens and copy the full key (starts with sk-).
  2. Set the two environment variables below (add them to ~/.zshrc or ~/.bashrc to keep them).
  3. Run claude. To pick a model, also set ANTHROPIC_MODEL with a name copied from the Models page.
export ANTHROPIC_BASE_URL=https://17astra.com
export ANTHROPIC_AUTH_TOKEN=sk-your-key
# optional
export ANTHROPIC_MODEL=claude-sonnet-4-6
claude

Do not add /v1 to the base URL: Claude Code appends /v1/messages itself.

2Codex CLI

Add a custom provider in config.toml

  1. Create a token under Console → API Tokens and copy the full key (starts with sk-).
  2. Edit ~/.codex/config.toml and add the configuration below.
  3. Export ASTRA_API_KEY in your shell, then run codex.
model = "gpt-5"
model_provider = "astra"

[model_providers.astra]
name = "Astra-api"
base_url = "https://17astra.com/v1"
env_key = "ASTRA_API_KEY"
wire_api = "responses"
export ASTRA_API_KEY=sk-your-key
codex

3Gemini CLI

Connect with the native Gemini protocol

  1. Create a token under Console → API Tokens and copy the full key (starts with sk-).
  2. Set the variables below and run gemini; use -m to choose a model.
export GOOGLE_GEMINI_BASE_URL=https://17astra.com
export GEMINI_API_KEY=sk-your-key
gemini -m gemini-2.5-pro

4Cline / Roo Code (VS Code)

Use the OpenAI Compatible provider

  1. Create a token under Console → API Tokens and copy the full key (starts with sk-).
  2. Open the extension settings and choose OpenAI Compatible as the API provider.
  3. Set Base URL to https://17astra.com/v1 and paste your key.
  4. Enter the exact model name from the Models page as the Model ID and save.