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
Python
JavaScript
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

LimitDefault
Requests per minute60
Requests per day10,000
Max API keys per account5

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.

PackageCreditsPrice
Starter500$5
Builder2,500$25
Scale5,000$50
Pro10,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"
  }
}
StatusTypeMeaning
401authentication_errorInvalid or missing API key
402billing_errorInsufficient credits
429rate_limit_errorRPM or RPD exceeded (check Retry-After header)
400invalid_request_errorMissing or invalid parameters
404invalid_request_errorEndpoint not found
500server_errorInternal 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

ModelProviderInput/1MOutput/1MContextStatus
google/gemini-2.5-flashVertex AI$0.15$0.601MLive
google/gemini-2.5-proVertex AI$1.25$5.001MLive
anthropic/claude-4.5-sonnetAnthropic$3.00$15.00200KActivating
openai/gpt-5OpenAI$2.50$10.00128KActivating
openai/gpt-5-miniOpenAI$0.15$0.60128KActivating
deepseek/deepseek-r1OpenRouter$0.55$2.19128KActivating
meta/llama-3.3-70bOpenRouter$0.40$0.40128KActivating
perplexity/sonar-proPerplexity$3.00$15.00200KActivating

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

PrefixProviderEndpointsExample
apify/*Apify30 actorsapify/linkedin-profile
sc/*Scrapecreators48sc/tiktok-user
ed/*EnsembleData13ed/instagram-user-info
firecrawl/*Firecrawl3firecrawl/scrape
linkup/*Linkup3linkup/search
prelude/*Prelude3prelude/verify-send
reducto/*Reducto2reducto/parse
replicate/*Replicate16replicate/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"}'
Full Report · Foundry Dashboard · Deliveries · Platform