AI Gateway

Models available to every worker

Call language models from any worker without managing provider keys. Add ai: true to ploy.yaml and your deployment receives an env.AI binding plus an OpenAI-compatible base URL and token, so existing SDKs work unchanged. Usage is metered per project, and the same credentials flow into sandboxes for coding agents.

AI in a Worker

AI Query Generator

Describe what you want in natural language and AI will generate the SQL query

Example Queries

See how natural language translates to SQL

Prompt
Show me users who signed up this month
SELECT * FROM users WHERE created_at >= DATE_TRUNC('month', CURRENT_DATE)
Prompt
Top 10 products by revenue
SELECT p.name, SUM(oi.quantity * oi.price) as revenue
FROM products p
JOIN order_items oi ON p.id = oi.product_id
GROUP BY p.id, p.name
ORDER BY revenue DESC
LIMIT 10
Prompt
Users with more than 5 orders
SELECT u.name, u.email, COUNT(o.id) as order_count
FROM users u
JOIN orders o ON u.id = o.user_id
GROUP BY u.id, u.name, u.email
HAVING COUNT(o.id) > 5

Key Features

env.AI.run()

One call with a model name and inputs. No SDK required for the common case.

OpenAI-Compatible

Point the OpenAI or Anthropic SDK at the injected base URL and token and keep your existing code.

No Provider Keys

Tokens are minted per deployment and rotated for you, so agents never ship with a long-lived secret.

Agent SDK & Skills

Build agents with @meetploy/agent-sdk, and let coding assistants scaffold Ploy apps with the published skills.

AI Binding

Enable AI in ploy.yaml and call a model from the worker.

src/index.ts
export default {
  async fetch(request, env) {
    const { prompt } = await request.json();

    const result = await env.AI.run("glm-4.6v-flash", { prompt });

    return Response.json(result);
  },
} satisfies Ploy;

Ready to get started?

Deploy your first project in minutes with Ploy.