๐ 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.