Skip to content

Set your two env vars

Choose the variable pair that matches the client protocol. The NexoAI base and issued key are identical in both tabs; only the names differ.

Deux variables. Zéro confusion.

bash
export ANTHROPIC_BASE_URL="https://api.nexoai.ma"
export ANTHROPIC_AUTH_TOKEN="sk-your-key"
bash
export OPENAI_BASE_URL="https://api.nexoai.ma"
export OPENAI_API_KEY="sk-your-key"
powershell
$env:ANTHROPIC_BASE_URL = "https://api.nexoai.ma"
$env:ANTHROPIC_AUTH_TOKEN = "sk-your-key"
powershell
$env:OPENAI_BASE_URL = "https://api.nexoai.ma"
$env:OPENAI_API_KEY = "sk-your-key"
Client expectsBase variableKey variable
Anthropic-compatible APIANTHROPIC_BASE_URLANTHROPIC_AUTH_TOKEN
OpenAI-compatible APIOPENAI_BASE_URLOPENAI_API_KEY

Do not add /v1 to these two general environment variables. A specific SDK or config file may require a versioned base URL; those pages show it explicitly. For example, Codex's provider block uses https://api.nexoai.ma/v1 because Codex appends the Responses API route to that provider base.

Verify without exposing the key

bash
printf '%s\n' "$OPENAI_BASE_URL"
test -n "$OPENAI_API_KEY" && echo "key is set"

The first command should print https://api.nexoai.ma; the second should print key is set. Use the Anthropic variable names instead when checking Claude Code.

One protocol pair per client

Setting all four variables is allowed, but it can make troubleshooting harder. Start with the pair required by the current tool, verify one request, then add the other pair if you need both protocols.

Never commit the real value

Shell history, dotfiles, and .env files can leak credentials. Keep private startup files permissioned appropriately and store deployed keys in a secret manager.

Continue with Claude Code, Codex, or a curl request.

Built for developers across MENA.