AWS Accounts
AWS Accounts
{{ currentAwsAccount?.name }} Nodes
{{ currentProxyNode?.name }}
Cloud Environments
Select an AWS account to view or deploy proxy nodes.
{{ aws.name }}
{{ aws.region }}
{{ proxyItems.filter(p => p.awsAccountId === aws.id).length }} Nodes
Manage
Register AWS Account
{{ currentAwsAccount?.name }} Proxies
Deploy or activate GCP proxy nodes. Only ONE node can be active per account.
{{ item.name }}
Booting Running Starting Node... Sleeping Connecting... Offline{{ item.id }}
No nodes deployed in this account yet.
Deploy New Node
Google Cloud (Gemini API) Setup:
- Go to the Google Cloud Console.
- Create a new project or select an existing one.
- Search for Vertex AI API (the enterprise backend for Gemini) and click Enable.
- Navigate to IAM & Admin > Service Accounts.
- Click Create Service Account, name it (e.g.,
gemini-proxy), and click Continue. - Assign the role Vertex AI User, then click Done.
- Click the newly created account, go to the Keys tab.
- Select Add Key > Create new key > JSON.
- Download the file and drag-and-drop it below!
Drag & Drop JSON file
or click to browse
{{ newProxy.fileName || 'JSON Loaded' }}
Ready to deploy
{{ currentProxyNode?.name }}
Booting EC2... Ready Starting App... Sleeping Checking State... OfflineID: {{ currentProxyNode?.id }}
AWS Telemetry
State:
{{ nodeStatus.state.toUpperCase() }}
IP:
{{ nodeStatus.publicIp || '---.---.---.---' }}
API Keys
{{ apiKeys.length }}
{{ k.name }}
No API keys generated.
API Playground (Live Stream)
Response stream will appear here...
Node must be READY to test API.
(Current State: {{ nodeStatus.state === 'running' && !nodeStatus.appReady ? 'Booting App...' : nodeStatus.state }})
Model Thinking
{{ pgThinking }}
{{ pgOutput }}
import openai
client = openai.OpenAI(
api_key="{{ pgKey || 'YOUR_API_KEY' }}",
base_url="{{ activeHost }}/v1"
)
# Standard Text completion (Translated to Gemini Flash)
response = client.chat.completions.create(
model="gemini-2.5-flash",
temperature=0.7,
messages=[{"role": "user", "content": "Hello!"}]
)
# Prints the model's thinking process (if supported)
if hasattr(response.choices[0].message, "reasoning_content") and response.choices[0].message.reasoning_content:
print("--- THINKING ---")
print(response.choices[0].message.reasoning_content)
print("----------------")
print(response.choices[0].message.content)
# Token Consumption Tracking
if response.usage:
print(f"\n[Usage] Prompt: {response.usage.prompt_tokens} | Completion: {response.usage.completion_tokens} | Total: {response.usage.total_tokens}")
if getattr(response.usage, "completion_tokens_details", None):
print(f" Reasoning Tokens: {response.usage.completion_tokens_details.reasoning_tokens}")import OpenAI from 'openai';
const openai = new OpenAI({
apiKey: '{{ pgKey || 'YOUR_API_KEY' }}',
baseURL: '{{ activeHost }}/v1'
});
async function main() {
// Standard text completion
const response = await openai.chat.completions.create({
model: 'gemini-2.5-flash',
temperature: 0.7,
messages:[{ role: 'user', content: 'Hello!' }]
});
const message = response.choices[0]?.message;
if (message?.reasoning_content) {
console.log("--- THINKING ---");
console.log(message.reasoning_content);
console.log("----------------");
}
console.log(message?.content);
// Token Consumption Tracking
if (response.usage) {
console.log(`\n[Usage] Prompt: ${response.usage.prompt_tokens} | Completion: ${response.usage.completion_tokens} | Total: ${response.usage.total_tokens}`);
if (response.usage.completion_tokens_details?.reasoning_tokens) {
console.log(` Reasoning Tokens: ${response.usage.completion_tokens_details.reasoning_tokens}`);
}
}
}
main();curl {{ activeHost }}/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {{ pgKey || 'YOUR_API_KEY' }}" \
-d '{
"model": "gemini-2.5-flash",
"temperature": 0.7,
"messages": [
{ "role": "system", "content": "You are a helpful assistant." },
{ "role": "user", "content": "Hello!" }
]
}'
# The JSON response natively includes a "usage" object containing token metrics.import openai
import sys
client = openai.OpenAI(
api_key="{{ pgKey || 'YOUR_API_KEY' }}",
base_url="{{ activeHost }}/v1"
)
response = client.chat.completions.create(
model="gemini-2.5-flash",
temperature=0.7,
messages=[{"role": "user", "content": "Count to 10"}],
stream=True,
stream_options={"include_usage": True}
)
is_thinking = False
for chunk in response:
# The final chunk contains usage statistics instead of choices
if not chunk.choices and chunk.usage:
print(f"\n[Usage] Prompt: {chunk.usage.prompt_tokens} | Completion: {chunk.usage.completion_tokens} | Total: {chunk.usage.total_tokens}")
if getattr(chunk.usage, "completion_tokens_details", None):
print(f" Reasoning Tokens: {chunk.usage.completion_tokens_details.reasoning_tokens}")
continue
delta = chunk.choices[0].delta
# Check if reasoning_content (thoughts) exists
if hasattr(delta, 'reasoning_content') and delta.reasoning_content is not None:
if not is_thinking:
sys.stdout.write("\n--- THINKING ---\n")
is_thinking = True
sys.stdout.write(delta.reasoning_content)
sys.stdout.flush()
# Otherwise, it's final content
elif hasattr(delta, 'content') and delta.content is not None:
if is_thinking:
sys.stdout.write("\n----------------\n")
is_thinking = False
sys.stdout.write(delta.content)
sys.stdout.flush()
import OpenAI from 'openai';
const openai = new OpenAI({
apiKey: '{{ pgKey || 'YOUR_API_KEY' }}',
baseURL: '{{ activeHost }}/v1'
});
async function main() {
// Streaming response natively through the EC2 Proxy
const stream = await openai.chat.completions.create({
model: 'gemini-2.5-flash',
temperature: 0.7,
messages:[{ role: 'user', content: 'Count to 10' }],
stream: true,
stream_options: { include_usage: true }
});
let isThinking = false;
for await (const chunk of stream) {
// The final chunk contains usage statistics instead of choices
if (chunk.usage && chunk.choices.length === 0) {
console.log(`\n[Usage] Prompt: ${chunk.usage.prompt_tokens} | Completion: ${chunk.usage.completion_tokens} | Total: ${chunk.usage.total_tokens}`);
if (chunk.usage.completion_tokens_details?.reasoning_tokens) {
console.log(` Reasoning Tokens: ${chunk.usage.completion_tokens_details.reasoning_tokens}`);
}
continue;
}
const delta = chunk.choices[0]?.delta;
if (delta?.reasoning_content) {
if(!isThinking) { process.stdout.write("\n--- THINKING ---\n"); isThinking = true; }
process.stdout.write(delta.reasoning_content);
} else if (delta?.content) {
if(isThinking) { process.stdout.write("\n----------------\n"); isThinking = false; }
process.stdout.write(delta.content);
}
}
}
main();curl {{ activeHost }}/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {{ pgKey || 'YOUR_API_KEY' }}" \
-d '{
"model": "gemini-2.5-flash",
"temperature": 0.7,
"stream": true,
"stream_options": { "include_usage": true },
"messages": [
{ "role": "system", "content": "You are a helpful assistant." },
{ "role": "user", "content": "Count to 10" }
]
}'import openai
import base64
def encode_image(image_path):
with open(image_path, "rb") as image_file:
return base64.b64encode(image_file.read()).decode('utf-8')
base64_image = encode_image("path_to_image.jpg")
client = openai.OpenAI(
api_key="{{ pgKey || 'YOUR_API_KEY' }}",
base_url="{{ activeHost }}/v1"
)
response = client.chat.completions.create(
model="gemini-2.5-flash",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "What is in this image?"},
{"type": "image_url", "image_url": {"url": f"data:image/jpeg;base64,{base64_image}"}}
]
}
]
)
print(response.choices[0].message.content)
if response.usage:
print(f"\n[Usage] Prompt: {response.usage.prompt_tokens} | Completion: {response.usage.completion_tokens} | Total: {response.usage.total_tokens}")
if getattr(response.usage, "completion_tokens_details", None):
print(f" Reasoning Tokens: {response.usage.completion_tokens_details.reasoning_tokens}")import OpenAI from 'openai';
import fs from 'fs';
const openai = new OpenAI({
apiKey: '{{ pgKey || 'YOUR_API_KEY' }}',
baseURL: '{{ activeHost }}/v1'
});
const base64Image = fs.readFileSync('path_to_image.jpg', { encoding: 'base64' });
async function main() {
const response = await openai.chat.completions.create({
model: 'gemini-2.5-flash',
messages: [
{
role: 'user',
content: [
{ type: 'text', text: 'What is in this image?' },
{ type: 'image_url', image_url: { url: `data:image/jpeg;base64,${base64Image}` } }
]
}
],
});
console.log(response.choices[0].message.content);
if (response.usage) {
console.log(`\n[Usage] Prompt: ${response.usage.prompt_tokens} | Completion: ${response.usage.completion_tokens} | Total: ${response.usage.total_tokens}`);
if (response.usage.completion_tokens_details?.reasoning_tokens) {
console.log(` Reasoning Tokens: ${response.usage.completion_tokens_details.reasoning_tokens}`);
}
}
}
main();curl {{ activeHost }}/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {{ pgKey || 'YOUR_API_KEY' }}" \
-d '{
"model": "gemini-2.5-flash",
"messages": [
{
"role": "user",
"content": [
{ "type": "text", "text": "What is in this image?" },
{ "type": "image_url", "image_url": { "url": "data:image/jpeg;base64,BASE64_IMAGE_STRING_HERE" } }
]
}
]
}'import openai
import base64
client = openai.OpenAI(
api_key="{{ pgKey || 'YOUR_API_KEY' }}",
base_url="{{ activeHost }}/v1"
)
# Using with_raw_response to access custom headers and billing data injected by the Proxy
raw_response = client.images.with_raw_response.generate(
model="gemini-3.1-flash-image-preview",
prompt="A futuristic cyberpunk city at sunset, highly detailed digital art.",
n=1,
size="{{ imgSize }}"
)
response = raw_response.parse()
# Print Custom Proxy Cost Tracking
print("[Headers] Images Generated:", raw_response.headers.get("x-zeroburn-images-count"))
print("[Headers] Resolution:", raw_response.headers.get("x-zeroburn-resolution"))
json_data = raw_response.json()
if "usage" in json_data:
print(f"[Usage] Virtual Tokens Consumed: {json_data['usage']['total_tokens']}")
# Decode and save the base64 string to an image file
image_b64 = response.data[0].b64_json
with open("output.png", "wb") as fh:
fh.write(base64.b64decode(image_b64))
print("Image successfully generated and saved to output.png")import OpenAI from 'openai';
import fs from 'fs';
const openai = new OpenAI({
apiKey: '{{ pgKey || 'YOUR_API_KEY' }}',
baseURL: '{{ activeHost }}/v1'
});
async function main() {
// Using withResponse() to capture proxy-injected headers and metadata
const { data: response, response: raw } = await openai.images.generate({
model: 'gemini-3.1-flash-image-preview',
prompt: 'A futuristic cyberpunk city at sunset, highly detailed digital art.',
n: 1,
size: '{{ imgSize }}'
}).withResponse();
console.log("[Headers] Resolution:", raw.headers.get('x-zeroburn-resolution'));
// The Proxy injects Virtual Tokens (usage) and custom _billing metadata
if (response.usage) console.log("[Usage] Virtual Tokens Consumed:", response.usage.total_tokens);
if (response._billing) console.log("[Billing] Metadata:", response._billing);
// Decode and save the base64 string to an image file
const buffer = Buffer.from(response.data[0].b64_json, 'base64');
fs.writeFileSync('output.png', buffer);
console.log("Image successfully generated and saved to output.png");
}
main();# Streams the JSON output directly to a native python decoder to save as output.png
curl -s {{ activeHost }}/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {{ pgKey || 'YOUR_API_KEY' }}" \
-d '{
"model": "gemini-3.1-flash-image-preview",
"prompt": "A futuristic cyberpunk city at sunset, highly detailed digital art.",
"n": 1,
"size": "{{ imgSize }}"
}' | python3 -c "
import sys, json, base64
response = json.load(sys.stdin)
with open('output.png', 'wb') as f:
f.write(base64.b64decode(response['data'][0]['b64_json']))
print('Image successfully generated and saved to output.png')
if 'usage' in response:
print(f"[Usage] Virtual Tokens Consumed: {response['usage']['total_tokens']}")
"import requests
import base64
# The OpenAI SDK strictly expects a single file. For multiple images, use standard HTTP requests.
url = "{{ activeHost }}/v1/images/edits"
headers = {"Authorization": "Bearer {{ pgKey || 'YOUR_API_KEY' }}"}
# Pass multiple images by providing a list of tuples for the 'image' key
files =[
("image", ("image1.jpg", open("image1.jpg", "rb"))),
("image", ("image2.jpg", open("image2.jpg", "rb")))
]
data = {
"model": "gemini-3.1-flash-image-preview",
"prompt": "Combine these images into a highly detailed cyberpunk scene",
"n": "1",
"size": "{{ imgSize }}"
}
raw_response = requests.post(url, headers=headers, files=files, data=data)
response = raw_response.json()
print("[Headers] Resolution:", raw_response.headers.get("X-ZeroBurn-Resolution"))
if "usage" in response:
print(f"[Usage] Virtual Tokens Consumed: {response['usage']['total_tokens']}")
# Decode and save the base64 output
with open("output_edit.png", "wb") as f:
f.write(base64.b64decode(response['data'][0]['b64_json']))
print("Edited image saved to output_edit.png")import fs from 'fs';
// The OpenAI SDK strictly expects a single file. For multiple images, use standard Fetch/FormData.
async function main() {
const formData = new FormData();
// Append multiple images to the same 'image' field
formData.append('image', new Blob([fs.readFileSync('image1.jpg')]), 'image1.jpg');
formData.append('image', new Blob([fs.readFileSync('image2.jpg')]), 'image2.jpg');
formData.append('model', 'gemini-3.1-flash-image-preview');
formData.append('prompt', 'Combine these images into a highly detailed cyberpunk scene');
formData.append('n', '1');
formData.append('size', '{{ imgSize }}');
const res = await fetch('{{ activeHost }}/v1/images/edits', {
method: 'POST',
headers: { 'Authorization': 'Bearer {{ pgKey || 'YOUR_API_KEY' }}' },
body: formData
});
console.log("[Headers] Resolution:", res.headers.get("X-ZeroBurn-Resolution"));
const response = await res.json();
if (response.usage) console.log("[Usage] Virtual Tokens Consumed:", response.usage.total_tokens);
// Decode and save the base64 output
const buffer = Buffer.from(response.data[0].b64_json, 'base64');
fs.writeFileSync('output_edit.png', buffer);
console.log("Edited image saved to output_edit.png");
}
main();curl -s {{ activeHost }}/v1/images/edits \
-H "Authorization: Bearer {{ pgKey || 'YOUR_API_KEY' }}" \
-F "model=gemini-3.1-flash-image-preview" \
-F "image=@image1.jpg" \
-F "image=@image2.jpg" \
-F "prompt=Combine these images into a highly detailed cyberpunk scene" \
-F "n=1" \
-F "size={{ imgSize }}" | python3 -c "
import sys, json, base64
response = json.load(sys.stdin)
with open('output_edit.png', 'wb') as f:
f.write(base64.b64decode(response['data'][0]['b64_json']))
print('Edited image saved to output_edit.png')
if 'usage' in response:
print(f"[Usage] Virtual Tokens Consumed: {response['usage']['total_tokens']}")
"import openai
import requests
import base64
client = openai.OpenAI(
api_key="{{ pgKey || 'YOUR_API_KEY' }}",
base_url="{{ activeHost }}/v1"
)
seed_val = {{ imgSeed || 42791 }}
# --- Example 1: Image Generation with Deterministic Seed ---
gen_response = client.images.generate(
model="gemini-3.1-flash-image-preview",
prompt="A futuristic cyberpunk city at sunset, highly detailed digital art.",
n=1,
size="{{ imgSize }}",
# Bypass OpenAI typing by using extra_body to pass seed to Vertex proxy
extra_body={"seed": seed_val}
)
with open("gen_output.png", "wb") as fh:
fh.write(base64.b64decode(gen_response.data[0].b64_json))
print("Generated image saved.")
# --- Example 2: Image Editing with Deterministic Seed ---
# The OpenAI Python SDK strictly restricts the edits endpoint fields.
# Use standard requests to pass standard form-data alongside the seed.
url = "{{ activeHost }}/v1/images/edits"
headers = {"Authorization": f"Bearer {client.api_key}"}
files = [("image", ("gen_output.png", open("gen_output.png", "rb")))]
data = {
"model": "gemini-3.1-flash-image-preview",
"prompt": "Add a flying car to the scene",
"n": "1",
"size": "{{ imgSize }}",
"seed": str(seed_val)
}
edit_response_raw = requests.post(url, headers=headers, files=files, data=data)
edit_response = edit_response_raw.json()
if "usage" in edit_response:
print(f"[Usage] Virtual Tokens: {edit_response['usage']['total_tokens']}")
with open("edit_output.png", "wb") as f:
f.write(base64.b64decode(edit_response['data'][0]['b64_json']))
print("Edited image saved.")import OpenAI from 'openai';
import fs from 'fs';
const openai = new OpenAI({
apiKey: '{{ pgKey || 'YOUR_API_KEY' }}',
baseURL: '{{ activeHost }}/v1'
});
async function main() {
const seedVal = {{ imgSeed || 42791 }};
// --- Example 1: Image Generation with Deterministic Seed ---
const genRes = await openai.images.generate({
model: 'gemini-3.1-flash-image-preview',
prompt: 'A futuristic cyberpunk city at sunset, highly detailed digital art.',
n: 1,
size: '{{ imgSize }}',
// @ts-ignore - Bypass strict TS types to send seed param to proxy
extra_body: { seed: seedVal }
});
fs.writeFileSync('gen_output.png', Buffer.from(genRes.data[0].b64_json, 'base64'));
console.log("Generated image saved.");
// --- Example 2: Image Editing with Deterministic Seed ---
const formData = new FormData();
formData.append('image', new Blob([fs.readFileSync('gen_output.png')]), 'gen_output.png');
formData.append('model', 'gemini-3.1-flash-image-preview');
formData.append('prompt', 'Add a flying car to the scene');
formData.append('n', '1');
formData.append('size', '{{ imgSize }}');
formData.append('seed', seedVal.toString());
const editRes = await fetch('{{ activeHost }}/v1/images/edits', {
method: 'POST',
headers: { 'Authorization': 'Bearer {{ pgKey || 'YOUR_API_KEY' }}' },
body: formData
});
const editData = await editRes.json();
if (editData.usage) console.log("[Usage] Virtual Tokens:", editData.usage.total_tokens);
fs.writeFileSync('edit_output.png', Buffer.from(editData.data[0].b64_json, 'base64'));
console.log("Edited image saved.");
}
main();# --- Example 1: Image Generation with Deterministic Seed ---
curl -s {{ activeHost }}/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {{ pgKey || 'YOUR_API_KEY' }}" \
-d '{
"model": "gemini-3.1-flash-image-preview",
"prompt": "A futuristic cyberpunk city at sunset, highly detailed digital art.",
"n": 1,
"size": "{{ imgSize }}",
"seed": {{ imgSeed || 42791 }}
}' | python3 -c "
import sys, json, base64
response = json.load(sys.stdin)
with open('gen_output.png', 'wb') as f:
f.write(base64.b64decode(response['data'][0]['b64_json']))
print('Generated image saved to gen_output.png')
if 'usage' in response: print(f"[Usage] Virtual Tokens: {response['usage']['total_tokens']}")
"
# --- Example 2: Image Editing with Deterministic Seed ---
# Uses the image generated from Example 1
curl -s {{ activeHost }}/v1/images/edits \
-H "Authorization: Bearer {{ pgKey || 'YOUR_API_KEY' }}" \
-F "model=gemini-3.1-flash-image-preview" \
-F "image=@gen_output.png" \
-F "prompt=Add a flying car to the scene" \
-F "n=1" \
-F "size={{ imgSize }}" \
-F "seed={{ imgSeed || 42791 }}" | python3 -c "
import sys, json, base64
response = json.load(sys.stdin)
with open('edit_output.png', 'wb') as f:
f.write(base64.b64decode(response['data'][0]['b64_json']))
print('Edited image saved to edit_output.png')
if 'usage' in response: print(f"[Usage] Virtual Tokens: {response['usage']['total_tokens']}")
"import openai
client = openai.OpenAI(
api_key="{{ pgKey || 'YOUR_API_KEY' }}",
base_url="{{ activeHost }}/v1"
)
# Use extra_body to pass the custom tools structure to the proxy
response = client.chat.completions.create(
model="gemini-2.5-flash",
messages=[{"role": "user", "content": "What is the weather in Tokyo today?"}],
extra_body={"tools":[{"googleSearch": {}}]}
)
print(response.choices[0].message.content)
if response.usage:
print(f"\n[Usage] Prompt: {response.usage.prompt_tokens} | Completion: {response.usage.completion_tokens} | Total: {response.usage.total_tokens}")
if getattr(response.usage, "completion_tokens_details", None):
print(f" Reasoning Tokens: {response.usage.completion_tokens_details.reasoning_tokens}")import OpenAI from 'openai';
const openai = new OpenAI({
apiKey: '{{ pgKey || 'YOUR_API_KEY' }}',
baseURL: '{{ activeHost }}/v1'
});
async function main() {
// You can inject the tools array natively in the payload
const response = await openai.chat.completions.create({
model: 'gemini-2.5-flash',
messages:[{ role: 'user', content: 'What is the weather in Tokyo today?' }],
tools: [{ googleSearch: {} }]
});
console.log(response.choices[0].message.content);
if (response.usage) {
console.log(`\n[Usage] Prompt: ${response.usage.prompt_tokens} | Completion: ${response.usage.completion_tokens} | Total: ${response.usage.total_tokens}`);
if (response.usage.completion_tokens_details?.reasoning_tokens) {
console.log(` Reasoning Tokens: ${response.usage.completion_tokens_details.reasoning_tokens}`);
}
}
}
main();curl {{ activeHost }}/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {{ pgKey || 'YOUR_API_KEY' }}" \
-d '{
"model": "gemini-2.5-flash",
"messages":[
{ "role": "user", "content": "What is the weather in Tokyo today?" }
],
"tools":[
{ "googleSearch": {} }
]
}'