Developer platform

Call AI models from your functions with one line.

env.AI gives your edge functions chat models and embeddings, with fallbacks, response caching, per-plan limits and usage by model. Models run on Amazon Bedrock.

// lyrcloud.json: "ai": "AI"
export default {
  async fetch(request, env) {
    const { response } = await env.AI.run('claude-haiku-4.5', {
      prompt: 'Summarize edge computing in one line.',
      max_tokens: 100,
    }, { cache: 3600, fallback: 'nova-lite' });
    return new Response(response);
  },
};
πŸ€– AI Gateway & Inference

What you get

One line to a model

env.AI.run(model, { prompt }) or a full conversation with messages and system.

Fallbacks

Pass { fallback: 'nova-lite' } and the gateway tries the next model when one is busy or unavailable.

Response caching

Pass { cache: 3600 } and identical requests are answered from cache, free and in milliseconds.

Embeddings

env.AI.embed(texts) returns Titan vectors in 256, 512 or 1024 dimensions.

Usage by model

lyrcloud ai usage shows requests and tokens per model, against your plan’s monthly budget.

Guardrails & vector search

Coming soon.

Works with the rest of Lyrcloud

🌐

Domains

Register or transfer a domain with free WHOIS privacy and Lyrcloud DNS, paid by card or with Lyrpay.

Learn more
⚑

Global CDN

Response caching, static files and whole static sites for your edge functions, with cache headers you control and purges from the CLI.

Learn more
πŸ”’

Application Security

Rate limits, IP rules, a firewall for common attacks, bot checks and secure headers for your edge functions, set in lyrcloud.json and enforced before your code runs.

Learn more

Try AI Gateway & Inference free.

Create a free account in under a minute. No credit card required.