๐Ÿ“š API Documentation

Learn how to integrate with our API using these examples

๐Ÿ”— API Endpoint

Base URL: http://www.lightningzeus.com/v1

Replace YOUR_API_KEY with your actual API key from the API Keys page.

๐Ÿš cURL Example

Make API requests directly from your terminal using cURL.

Basic Chat Completion

bash
#!/usr/bin/env sh

BASE_URL="http://www.lightningzeus.com/v1"
API_KEY="YOUR_API_KEY"

curl "$BASE_URL/chat/completions" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-4.5",
    "messages": [
      {"role": "user", "content": "Hello!"}
    ]
  }'

With Streaming

bash
# With streaming
curl "$BASE_URL/chat/completions" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-4.5",
    "messages": [
      {"role": "user", "content": "Hello!"}
    ],
    "stream": true
  }'

๐Ÿ“ค Expected Output

{ "choices": [ { "finish_reason": "stop", "message": { "content": "Hello! How are you doing today? Is there something I can help you with?", "role": "assistant" } } ], "created": 1769095572, "id": "msg_vrtx_01XNdd65BAkT82dLgksZGWD3", "usage": { "completion_tokens": 20, "prompt_tokens": 9, "prompt_tokens_details": { "cached_tokens": 0 }, "total_tokens": 29 }, "model": "claude-opus-4.5" }

๐Ÿ OpenAI SDK Example

Use the official OpenAI Python SDK with our API.

python
from openai import OpenAI

BASE_URL = "http://www.lightningzeus.com/v1"
API_KEY = "YOUR_API_KEY"


def main():
    client = OpenAI(
        api_key=API_KEY,
        base_url=BASE_URL,
    )

    response = client.chat.completions.create(
        model="claude-opus-4.5",
        messages=[
            {"role": "user", "content": "Hello!"}
        ],
    )

    print(response.choices[0].message.content)


if __name__ == "__main__":
    main()

๐Ÿ“ค Expected Output

Hello! How are you doing today? Is there something I can help you with?

๐ŸŒŠ Streaming Example

Stream responses in real-time using the requests library.

python
import requests

BASE_URL = "http://www.lightningzeus.com/v1"
API_KEY = "YOUR_API_KEY"


def main():
    response = requests.post(
        f"{BASE_URL}/chat/completions",
        headers={
            "Authorization": f"Bearer {API_KEY}",
            "Content-Type": "application/json",
        },
        json={
            "model": "claude-opus-4.5",
            "messages": [
                {"role": "user", "content": "Hello!"}
            ],
            "stream": True,
        },
        stream=True,
    )

    for line in response.iter_lines():
        if line:
            print(line.decode("utf-8"))


if __name__ == "__main__":
    main()

๐Ÿ“ค Expected Output

data: {"choices":[{"index":0,"delta":{"content":"Hello! How are","role":"assistant"}}],"created":1769095541,"id":"msg_vrtx_015r8zkxSn7FPCuAziyWJjgp","model":"claude-opus-4.5"} data: {"choices":[{"index":0,"delta":{"content":" you doing today?","role":"assistant"}}],"created":1769095541,"id":"msg_vrtx_015r8zkxSn7FPCuAziyWJjgp","model":"claude-opus-4.5"} data: {"choices":[{"index":0,"delta":{"content":" Is","role":"assistant"}}],"created":1769095541,"id":"msg_vrtx_015r8zkxSn7FPCuAziyWJjgp","model":"claude-opus-4.5"} data: {"choices":[{"index":0,"delta":{"content":" there something","role":"assistant"}}],"created":1769095541,"id":"msg_vrtx_015r8zkxSn7FPCuAziyWJjgp","model":"claude-opus-4.5"} data: {"choices":[{"index":0,"delta":{"content":" I can help you with?","role":"assistant"}}],"created":1769095541,"id":"msg_vrtx_015r8zkxSn7FPCuAziyWJjgp","model":"claude-opus-4.5"} data: {"choices":[{"finish_reason":"stop","index":0,"delta":{"content":null}}],"created":1769095541,"id":"msg_vrtx_015r8zkxSn7FPCuAziyWJjgp","usage":{"completion_tokens":20,"prompt_tokens":9,"prompt_tokens_details":{"cached_tokens":0},"total_tokens":29},"model":"claude-opus-4.5"} data: [DONE]

๐Ÿงช Test Completion

A complete test script with error handling and JSON output.

python
import requests
import json
import time

# Configuration
API_KEY = "YOUR_API_KEY"
BASE_URL = "http://www.lightningzeus.com/v1"

def run_chat_example():
    print(f"\n--- Testing Model: claude-opus-4.5 ---")
    url = f"{BASE_URL}/chat/completions"
    headers = {
        "Authorization": f"Bearer {API_KEY}",
        "Content-Type": "application/json"
    }
    
    payload = {
        "model": "claude-opus-4.5",
        "messages": [
            {"role": "user", "content": "Hello! Are you working?"}
        ]
    }

    try:
        response = requests.post(url, headers=headers, json=payload)
        print(f"Status Code: {response.status_code}")
        if response.status_code == 200:
            print("Response Body:")
            print(json.dumps(response.json(), indent=2))
        else:
            print(f"Error: {response.text}")
    except Exception as e:
        print(f"Failed to connect: {e}")

if __name__ == "__main__":
    # Wait a bit to ensure server is up if running in automation
    time.sleep(2)
    run_chat_example()

๐Ÿ“ค Expected Output

--- Testing Model: claude-opus-4.5 --- Status Code: 200 Response Body: { "choices": [ { "finish_reason": "stop", "message": { "content": "Hello! Yes, I'm working and ready to help. How can I assist you today?", "role": "assistant" } } ], "created": 1769095550, "id": "msg_vrtx_01DfUoCbURnkV7mQqYaoYjh2", "usage": { "completion_tokens": 22, "prompt_tokens": 13, "prompt_tokens_details": { "cached_tokens": 0 }, "total_tokens": 35 }, "model": "claude-opus-4.5" }

๐Ÿ–ฅ๏ธ Claude Code Configuration

Configure the Claude Code CLI to use this proxy.

Configuration File Location

  • Windows: %USERPROFILE%\.claude\settings.json
  • macOS / Linux: ~/.claude/settings.json

Configuration Content

Add the following to your configuration file (create it if it doesn't exist):

json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://www.lightningzeus.com/",
    "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
    "ANTHROPIC_MODEL": "claude-opus-4.5",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-opus-4.5",
    "ANTHROPIC_SMALL_FAST_MODEL": "claude-opus-4.5",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-opus-4.5",
    "DISABLE_NON_ESSENTIAL_MODEL_CALLS": "1",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
    "CLAUDE_CODE_ATTRIBUTION_HEADER": "0"
  },
  "permissions": {
    "deny": [
      "WebSearch"
    ]
  }
}

โš ๏ธ Replace YOUR_API_KEY with your actual API key.

๐Ÿ“– Additional Resources

๐Ÿ”‘ API Keys

Generate and manage your API keys securely.

Manage Keys โ†’

๐Ÿ“Š Usage Stats

Monitor your API usage and costs.

View Usage โ†’