Authentication

AIone supports both the OpenAI-compatible protocol and the Anthropic native protocol. Choose the appropriate authentication header and Base URL based on your client type.

OpenAI-Compatible Format

Use this for the OpenAI SDK, Cursor, Cline, Continue, and any custom client that supports OpenAI-compatible endpoints.

  • Base URL: https://api.portal.aiin1.ai/v1
  • Authentication header:
Authorization: Bearer sk-nex-xxxxxxxxxxxxxxxxxxxx

Example:

curl https://api.portal.aiin1.ai/v1/chat/completions \
  -H "Authorization: Bearer sk-nex-your-key-here" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-20250514",
    "messages": [{"role": "user", "content": "Hello"}],
    "max_tokens": 256
  }'

Anthropic Native Format

Use this for Claude Code, the Anthropic SDK, and clients that call the Messages API directly.

  • Base URL: https://api.portal.aiin1.ai
  • Authentication headers:
x-api-key: sk-nex-xxxxxxxxxxxxxxxxxxxx
anthropic-version: 2023-06-01

Example:

curl https://api.portal.aiin1.ai/v1/messages \
  -H "x-api-key: sk-nex-your-key-here" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-20250514",
    "messages": [{"role": "user", "content": "Hello"}],
    "max_tokens": 256
  }'

If your client only asks for a Base URL, use https://api.portal.aiin1.ai for Anthropic native clients. The SDK will automatically append /v1/messages as required by the protocol.

Gemini Native Format

For Google Gemini SDK, custom gateway aggregation, and clients that call the Gemini generateContent API directly.

  • Base URL: https://api.portal.aiin1.ai
  • Authentication header:
Authorization: Bearer sk-nex-xxxxxxxxxxxxxxxxxxxx

Example:

curl https://api.portal.aiin1.ai/v1beta/models/gemini-2.5-flash:generateContent \
  -H "Authorization: Bearer sk-nex-your-key-here" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [{"role": "user", "parts": [{"text": "Hello"}]}],
    "generationConfig": {"maxOutputTokens": 256}
  }'

The request format is identical to the Google Gemini API. See the Gemini Native API documentation for full parameter details.

Security Best Practices

  • API Keys use the sk-nex- prefix and can be created and managed in the AIone Console.
  • Never commit API Keys to source control repositories
  • Never hardcode API Keys in frontend code
  • Store keys in environment variables:
export AIONE_API_KEY="sk-nex-your-key-here"
import os
from openai import OpenAI
 
client = OpenAI(
    api_key=os.environ["AIONE_API_KEY"],
    base_url="https://api.portal.aiin1.ai/v1",
)

Key Management

Action Description
Create Console > API Keys > Create; optionally restrict which models the key can access
Rotate Create a new key, migrate your workloads, then disable or delete the old key
Disable / Enable Temporarily suspend or reactivate a key
Delete Permanently remove a key (irreversible)