API Reference
Base URL: https://apigateway-q66ryynraa-uc.a.run.app
OpenAI-compatible format. Drop-in replacement — change base URL and API key.
Quick Start
Get started in 30 seconds:
curl https://apigateway-q66ryynraa-uc.a.run.app/v1/chat/completions \
-H "Authorization: Bearer aaas_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "google/gemini-2.5-flash",
"messages": [{"role": "user", "content": "Hello!"}]
}'
from openai import OpenAI
client = OpenAI(
base_url="https://apigateway-q66ryynraa-uc.a.run.app/v1",
api_key="aaas_YOUR_KEY"
)
response = client.chat.completions.create(
model="google/gemini-2.5-flash",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://apigateway-q66ryynraa-uc.a.run.app/v1",
apiKey: "aaas_YOUR_KEY"
});
const response = await client.chat.completions.create({
model: "google/gemini-2.5-flash",
messages: [{ role: "user", content: "Hello!" }]
});
console.log(response.choices[0].message.content);
Authentication
All endpoints (except /v1/status) require a Bearer token:
Authorization: Bearer aaas_<64-char-hex>
Get your key at agents-as-a-service.com/gateway — 500 free credits on signup.
Rate Limits
| Limit | Default |
|---|---|
| Requests per minute | 60 |
| Requests per day | 10,000 |
| Max API keys per account | 5 |
Credits & Billing
Pay-as-you-go. $5 minimum top-up. Credits never expire. Every request is credit-checked before execution — you can never go negative.
| Package | Credits | Price |
|---|---|---|
| Starter | 500 | $5 |
| Builder | 2,500 | $25 |
| Scale | 5,000 | $50 |
| Pro | 10,000 | $100 |
Error Handling
All errors follow the OpenAI error format:
{
"error": {
"message": "Human-readable description",
"type": "authentication_error | rate_limit_error | billing_error | invalid_request_error | server_error",
"code": "error_code"
}
}
| Status | Type | Meaning |
|---|---|---|
| 401 | authentication_error | Invalid or missing API key |
| 402 | billing_error | Insufficient credits |
| 429 | rate_limit_error | RPM or RPD exceeded (check Retry-After header) |
| 400 | invalid_request_error | Missing or invalid parameters |
| 404 | invalid_request_error | Endpoint not found |
| 500 | server_error | Internal error |
GET /v1/models
List all available models. Returns OpenAI-compatible model list.
curl -H "Authorization: Bearer aaas_xxx" \ https://apigateway-q66ryynraa-uc.a.run.app/v1/models
Available Models
| Model | Provider | Input/1M | Output/1M | Context | Status |
|---|---|---|---|---|---|
| google/gemini-2.5-flash | Vertex AI | $0.15 | $0.60 | 1M | Live |
| google/gemini-2.5-pro | Vertex AI | $1.25 | $5.00 | 1M | Live |
| anthropic/claude-4.5-sonnet | Anthropic | $3.00 | $15.00 | 200K | Activating |
| openai/gpt-5 | OpenAI | $2.50 | $10.00 | 128K | Activating |
| openai/gpt-5-mini | OpenAI | $0.15 | $0.60 | 128K | Activating |
| deepseek/deepseek-r1 | OpenRouter | $0.55 | $2.19 | 128K | Activating |
| meta/llama-3.3-70b | OpenRouter | $0.40 | $0.40 | 128K | Activating |
| perplexity/sonar-pro | Perplexity | $3.00 | $15.00 | 200K | Activating |
Live Works now Activating Code deployed, provider key being configured
POST /v1/chat/completions
Create a chat completion. OpenAI-compatible format. Works with any OpenAI SDK by changing the base URL.
Request
{
"model": "google/gemini-2.5-flash",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is AaaS?"}
],
"temperature": 0.7,
"max_tokens": 1000
}
Response
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1711700000,
"model": "google/gemini-2.5-flash",
"choices": [{
"index": 0,
"message": {"role": "assistant", "content": "AaaS is..."},
"finish_reason": "stop"
}],
"usage": {"prompt_tokens": 25, "completion_tokens": 150, "total_tokens": 175}
}
POST /v1/embeddings
curl -X POST https://apigateway-q66ryynraa-uc.a.run.app/v1/embeddings \
-H "Authorization: Bearer aaas_xxx" \
-H "Content-Type: application/json" \
-d '{"input": "The quick brown fox", "model": "text-embedding-3-small"}'
POST /v1/images/generations
Generate images using FLUX, Stable Diffusion, Ideogram, or Recraft via Replicate.
curl -X POST https://apigateway-q66ryynraa-uc.a.run.app/v1/images/generations \
-H "Authorization: Bearer aaas_xxx" \
-H "Content-Type: application/json" \
-d '{
"model": "replicate/flux-schnell",
"prompt": "A cyberpunk cityscape at sunset",
"width": 1024,
"height": 1024
}'
POST /v1/videos/generations
Generate videos using Kling, Sora, or Runway via Replicate. Async — returns when complete.
curl -X POST https://apigateway-q66ryynraa-uc.a.run.app/v1/videos/generations \
-H "Authorization: Bearer aaas_xxx" \
-H "Content-Type: application/json" \
-d '{"model": "replicate/kling-v2.5", "prompt": "A drone flyover of mountains at dawn"}'
POST /v1/audio/speech
Text-to-speech via ElevenLabs (premium) or OpenAI TTS. Returns audio/mpeg.
curl -X POST https://apigateway-q66ryynraa-uc.a.run.app/v1/audio/speech \
-H "Authorization: Bearer aaas_xxx" \
-H "Content-Type: application/json" \
-d '{"model": "openai/tts-1", "input": "Hello world!", "voice": "alloy"}' \
--output speech.mp3
POST /v1/audio/transcriptions
Speech-to-text via OpenAI Whisper.
curl -X POST https://apigateway-q66ryynraa-uc.a.run.app/v1/audio/transcriptions \ -H "Authorization: Bearer aaas_xxx" \ -F "file=@recording.mp3" \ -F "model=openai/whisper-1"
POST /v1/audio/music
curl -X POST https://apigateway-q66ryynraa-uc.a.run.app/v1/audio/music \
-H "Authorization: Bearer aaas_xxx" \
-H "Content-Type: application/json" \
-d '{"model": "replicate/musicgen", "prompt": "Upbeat electronic track with synth pads"}'
GET /v1/compose/chains
List all available foundry agent chains. AaaS exclusive — no competitor offers this.
curl -H "Authorization: Bearer aaas_xxx" \ https://apigateway-q66ryynraa-uc.a.run.app/v1/compose/chains
Returns 7 chains: DevOps Full, DevOps Incident, Revenue, Customer Success, People, Finance, Legal.
GET /v1/compose/foundries
curl -H "Authorization: Bearer aaas_xxx" \ https://apigateway-q66ryynraa-uc.a.run.app/v1/compose/foundries
GET /v1/compose/skills
List all 63 composable skills with capabilities.
curl -H "Authorization: Bearer aaas_xxx" \ https://apigateway-q66ryynraa-uc.a.run.app/v1/compose/skills
POST /v1/compose/mega-grind
Execute the full foundry pipeline for a specific foundry.
curl -X POST https://apigateway-q66ryynraa-uc.a.run.app/v1/compose/mega-grind \
-H "Authorization: Bearer aaas_xxx" \
-H "Content-Type: application/json" \
-d '{"foundry": "F1", "dryRun": true}'
POST /v1/scrape/company
Extract company data from a domain — homepage content, about page, product descriptions.
curl -X POST https://apigateway-q66ryynraa-uc.a.run.app/v1/scrape/company \
-H "Authorization: Bearer aaas_xxx" \
-H "Content-Type: application/json" \
-d '{"domain": "stripe.com"}'
POST /v1/scrape/classify
Classify industry using Vertex AI. Returns: industry, segment, company stage, ICP, tech stack.
curl -X POST https://apigateway-q66ryynraa-uc.a.run.app/v1/scrape/classify \
-H "Authorization: Bearer aaas_xxx" \
-H "Content-Type: application/json" \
-d '{"scrapedContent": "...", "domain": "stripe.com"}'
POST /v1/run
Universal endpoint that routes to 118 sub-endpoints based on model ID prefix.
Model ID Prefixes
| Prefix | Provider | Endpoints | Example |
|---|---|---|---|
| apify/* | Apify | 30 actors | apify/linkedin-profile |
| sc/* | Scrapecreators | 48 | sc/tiktok-user |
| ed/* | EnsembleData | 13 | ed/instagram-user-info |
| firecrawl/* | Firecrawl | 3 | firecrawl/scrape |
| linkup/* | Linkup | 3 | linkup/search |
| prelude/* | Prelude | 3 | prelude/verify-send |
| reducto/* | Reducto | 2 | reducto/parse |
| replicate/* | Replicate | 16 | replicate/flux-schnell |
Example: Scrape LinkedIn profile
curl -X POST https://apigateway-q66ryynraa-uc.a.run.app/v1/run \
-H "Authorization: Bearer aaas_xxx" \
-H "Content-Type: application/json" \
-d '{
"model": "apify/linkedin-profile",
"input": {"url": "https://www.linkedin.com/in/example"}
}'
Example: Web search
curl -X POST https://apigateway-q66ryynraa-uc.a.run.app/v1/run \
-H "Authorization: Bearer aaas_xxx" \
-H "Content-Type: application/json" \
-d '{"model": "linkup/search", "input": {"query": "AI agent frameworks 2026"}}'
Example: Parse PDF
curl -X POST https://apigateway-q66ryynraa-uc.a.run.app/v1/run \
-H "Authorization: Bearer aaas_xxx" \
-H "Content-Type: application/json" \
-d '{"model": "reducto/parse", "input": {"document_url": "https://example.com/report.pdf"}}'
GET /v1/run/models
List all available models for /v1/run, grouped by provider.
curl -H "Authorization: Bearer aaas_xxx" \ https://apigateway-q66ryynraa-uc.a.run.app/v1/run/models
GET /v1/billing/balance
curl -H "Authorization: Bearer aaas_xxx" \ https://apigateway-q66ryynraa-uc.a.run.app/v1/billing/balance
{"balance": 50000, "balanceUsd": "$5.00"}
GET /v1/keys
curl -H "Authorization: Bearer aaas_xxx" \ https://apigateway-q66ryynraa-uc.a.run.app/v1/keys
POST /v1/keys/create
curl -X POST https://apigateway-q66ryynraa-uc.a.run.app/v1/keys/create \
-H "Authorization: Bearer aaas_xxx" \
-H "Content-Type: application/json" \
-d '{"name": "production"}'