One line to a model
env.AI.run(model, { prompt }) or a full conversation with messages and system.
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);
},
};
env.AI.run(model, { prompt }) or a full conversation with messages and system.
Pass { fallback: 'nova-lite' } and the gateway tries the next model when one is busy or unavailable.
Pass { cache: 3600 } and identical requests are answered from cache, free and in milliseconds.
env.AI.embed(texts) returns Titan vectors in 256, 512 or 1024 dimensions.
lyrcloud ai usage shows requests and tokens per model, against your planβs monthly budget.
Coming soon.
Register or transfer a domain with free WHOIS privacy and Lyrcloud DNS, paid by card or with Lyrpay.
Learn moreResponse caching, static files and whole static sites for your edge functions, with cache headers you control and purges from the CLI.
Learn moreRate 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 moreCreate a free account in under a minute. No credit card required.