API

AI API: run your own AI agents from any code

Send a request with the agent’s ID — and get an answer that takes its instructions, knowledge and connected services into account. Streaming responses, multi-turn conversations and calling functions in your systems. You can also connect your own provider’s models with your own key.

Starting credits after sign-up

Features

The whole agent in one request

POST /api/v1/responses with the agent’s ID or short name (slug). The request runs with its instructions, skills, connected services and knowledge base.

Streaming responses

Turn on stream — the response arrives in chunks as it is generated (SSE). Your app shows progress instead of waiting until the end.

Multi-turn conversations

Pass the ID of the previous response, and the agent continues the conversation with what was said in mind. No manual history stitching.

Function calling

Describe your system’s functions — the agent asks to call the right one and continues with the result. Find an order, check stock, create a ticket.

Resources and specification

API addresses (endpoints) for agents, chats, messages, files, libraries and models. An interactive reference and an OpenAPI specification for generating a client.

Your own provider key

Add a key from your own model provider — chats on those models don’t use Modelyx credits. Built-in tools are billed as usual.

How to start

  1. 1

    Create an agent and test it in the chat.

  2. 2

    Open the API keys section in settings and create a key with an expiration date.

  3. 3

    Send POST /api/v1/responses with the agent’s ID or slug in the model field.

  4. 4

    Explore the other endpoints in the interactive reference at /api/v1/docs.

API request example

curl https://app.modelyx.ai/api/v1/responses \
  -H "Authorization: Bearer $MODELYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "YOUR_AGENT_ID_OR_SLUG",
    "input": "Summarize the top 10 customer complaints from this week in 5 bullet points."
  }'

Example requests

Paste a request into Modelyx and adjust the details to your case.

Summarize the 10 main customer complaints from this week in 5 points.

Draft a reply to this customer email: polite, short, offering a replacement product.

FAQ

Where do I get an API key?

Open the API keys section in settings, click the button to create a key, set a name and expiration date, then copy the key. Store it in a secrets manager or an environment variable.

How are API runs paid for?

Runs are paid with your account’s credits — by card, or by invoice for companies. The agent ID is the last part of its page address.

Can I try the API for free?

API runs use credits the same way regular chats do. You get starter credits after signing up — you can spend them on test requests too. Plans are on the pricing page.

How is the Modelyx API different from my own provider key?

The Modelyx API runs your agents from external code. Your own provider key does the opposite: it adds that provider’s models inside Modelyx.

Does Auto work with my provider key?

No, Auto only chooses from Modelyx’s built-in models. To work with your own key, pick the provider’s model manually.

How do I keep my key safe?

Don’t put it in client-side code or send it in chats: anyone who has it can run agents on your credits. Set an expiration date, and if it leaks, create a new key.

Learn more in the knowledge base

See also

Try it on your own task

Describe your task in plain words — Modelyx picks the model and returns a finished result. Starting credits after sign-up.

Start for free