Playground
Try models from the console, compare them side by side, and export the request as code.
The Playground sends real requests to ai.ml from your browser, using one of your API keys. You set the model and parameters on the left, talk to the model in the middle, and read the cost, usage and routing of each answer on the right. Requests are billed like any other and appear in your request history. In the test environment they go to the sandbox and are not billed.
Set a key
The playground needs a key before it can send anything. Under Key, either:
- paste a key you already have and press Use; or
- press Create a playground key. This creates a key named
playgroundin a project of the environment you have selected, with theinferencescope only, that expires after 24 hours. It needs a role that can create keys: owner, admin or member.
The key is kept in this browser tab only. It is gone when you close the tab, and it is never included in a shared link or in exported code. Press forget to remove it sooner.
Choose a mode, dialect and model
At the top:
- Mode is
chat(a conversation with history),single-turn(each message on its own) orcompare(the same message to several models at once). - Dialect is OpenAI dialect or Anthropic dialect: the request format the playground uses, and the one exported code is written in.
Under Model, type to search the catalog and pick a model. The line below shows its name and context size, with a details link to the model's page. In compare mode, tick 2 to 4 models instead.
If the model is deprecated, a notice says so and names the replacement. Click the replacement to switch to it.
Set the prompt and parameters
- System prompt: instructions sent ahead of the conversation.
- Parameters:
max_tokens,temperature,top_p, stop sequences,seedand reasoning effort. A parameter the chosen model does not support is disabled and says why. - Tools: press Add tool and give a tool name, a description (the model reads this), a parameters schema, and optionally a mock result. See tool calling.
- Structured output (JSON schema): paste a schema the answer must follow. The editor checks it as you type; an invalid schema blocks sending. See structured output.
Tools and structured output are disabled, with the reason, for a model that does not support them.
Send a message
- Type in the message box.
- Optionally press Attach to add files: images (PNG, JPEG, WebP, GIF, up to 10 MB), PDFs (up to 32 MB) or audio (MP3, WAV, M4A, WebM, up to 25 MB). A file of another type or over the limit is refused with a message. Remove an attachment with the cross beside it.
- Press Send, or Cmd+Enter (Ctrl+Enter on Windows and Linux).
The answer streams in. While it does:
- Stop ends the answer where it is.
- Regenerate, once it has finished, sends the last message again for a new answer.
If the model shows its reasoning, it appears above the answer.
When the model calls a tool
When the model calls one of your tools, the playground pauses and lists each call with its arguments. Enter a result for each and press Send results, or press Use mock results to answer with the mock results you set in the tools editor. The model then continues.
Compare mode
In compare mode, one message goes to every selected model and the answers appear side by side, each with its cost, time to first token, total time and token count. An error from one model is shown in its own cell and does not stop the others.
Read the result
The panel on the right shows, for the latest answer:
- Cost: the total cost of the session so far, and the input, cached, output and reasoning tokens of the last answer.
- served by: the provider and endpoint that answered.
- Time to first token and total time.
- request: the request id, linked to its entry in your request history.
- Warnings: anything the gateway adjusted or ignored in your request.
- Route trace: how the router chose the endpoint.
A note appears if the gateway restarted the stream on another host part of the way through.
When something goes wrong
- Not enough credits: the message says how much the request needed and links to Top up. See credits.
- Rate limited: the message names the limit and counts down until you can retry. Send is disabled until then.
- The stream stopped mid-way: the partial answer is kept.
Each error shows its request id and a Retry button. Error codes are listed in errors.
Save, fork, share and export
- Save keeps the session in this browser. Saved sessions are listed on the right under Saved sessions; click one to reopen it. They are stored in the browser, not on your account, so they do not follow you to another device.
- Fork copies the current session, so you can try a change without losing the original.
- Share copies a link that contains the session: model, prompt, parameters, tools and conversation, without attachments and without your key. Anyone who opens it gets their own copy and needs their own key to run it.
- Export as code shows the last request as
curl,tsorpython. The key is never included; put your own in.
Related
- Models to find a model and open it here.
- Quickstarts for OpenAI-compatible and Anthropic-compatible code.