Set up a provider
Choose which AI provider to use and enter its API key. Keys are saved in Eclipse secure storage, which on macOS is protected by the Keychain, never in Studio's plain settings files.
Open Settings
On macOS, choose Anypoint Studio > Settings… (Cmd+,). On Windows, choose Window > Preferences. You can also click Settings in the view header.

All 6 steps as a list
- Open Settings. On macOS, choose Anypoint Studio > Settings… (Cmd+,). On Windows, choose Window > Preferences. You can also click Settings in the view header.
- Pick a provider. Select MuleSoftForge Studio AI on the left. Open the Provider list and pick your provider: OpenRouter, OpenAI, Anthropic, Google Gemini, Azure OpenAI, Amazon Bedrock, Ollama (local) or Other OpenAI-compatible.
- Paste your API key. The Base URL fills in for the provider. Paste your API key. Under the field, Studio shows only the start, the last characters and the length of the key. For OpenAI-compatible providers, API chooses Chat Completions or Responses (use Responses for GPT-5.6 / GPT-6 tools with reasoning on OpenAI or Foundry). Auto fast model and Auto strong model are the two models that Auto uses.
- Choose a model. Pick a Model from the list, or type any model id. Auto sends simple questions to the fast model and changes, reviews, fixes and images to the strong model. On OpenRouter,
openrouter/autolets OpenRouter pick. - Refresh the model list. Click Refresh models to load the models that your account can use. The line under the buttons shows how many models it loaded.
- Test the connection. Click Test connection. It sends a one-word request to the model. Connected. Model replied: ok means that the provider, model and key work. If it fails, the message shows the HTTP status and the response from the provider. Then click Apply and Close.
If saving fails with No password provided, see Troubleshooting.
OpenAI Responses API
OpenRouter, OpenAI, MuleSoft AI Gateway and Other OpenAI-compatible offer an API setting: Chat Completions (the default) or Responses.
Choose Responses when the model needs the Responses API for tools with reasoning — for example GPT-5.6 and GPT-6 on OpenAI or Microsoft Foundry. Chat Completions rejects that combination unless reasoning is turned off. Point Other OpenAI-compatible at Foundry with base URL https://{resource}.openai.azure.com/openai/v1, set the model to your deployment name, and pick Responses. Keep Chat Completions for Claude behind a gateway: its prompt-cache marks are sent only on that path.
The Azure OpenAI provider still uses Chat Completions through the Azure SDK. For Foundry Responses, use Other OpenAI-compatible as above.
Other settings
The same page has more settings under the provider:
- Chat view: the rich chat view, the update check, and hiding passwords, keys, tokens, email addresses and phone numbers from the model.
- Instructions: your own rules for every chat. See Your instructions.
- HTTP and documentation: the hosts that the AI can read docs from, and extra HTTP guidance.
- Network: company certificates, for Zscaler and similar proxies.
- DataWeave CLI: where to find
dw, and a download button. - Chat history: save chats, how many days to keep them, and the raw log of each request and response.
Settings in every workspace
From 0.5.35, these settings are shared by every Studio workspace on your computer, so a new workspace is ready to use. They are saved in ~/.mulesoftforge/studio-ai/settings.properties. API keys stay in secure storage, which every workspace already shared.
To give one workspace its own settings, for example a different provider for a client, tick Use these settings in this workspace only at the top of the page. It starts from your shared settings; changes you make then stay in that workspace. Clear it to go back to the shared settings.
Chats are saved per workspace, never in your Mule projects, and API keys are never written to them. To see every workspace's chats in History ▾, tick Show saved chats in every workspace under Chat history.

Your instructions
Your instructions go with every message in every project. Use them for rules that you want each time, so you do not type them again. For rules that belong to one project and its team, use an AGENTS.md file at the project root. See Give it standing instructions.
Write your instructions
Scroll to Instructions. Type or paste your rules in Your instructions (every chat, every project), up to 8,000 characters. They go with every message, after secrets are masked.

All 2 steps as a list
- Write your instructions. Scroll to Instructions. Type or paste your rules in Your instructions (every chat, every project), up to 8,000 characters. They go with every message, after secrets are masked.
- See the built-in prompt. Click Show built-in prompt to see the text that goes before your instructions. Your instructions can change the general guidance. They cannot change the rules: masked values stay masked, and changes stay proposals that you review.
Example: metadata rules for Mule 4
Studio checks each sub-flow and private flow by itself, so DataWeave often shows errors such as Unable to resolve reference of: payload. The AI can try to fix these by changing the flows. These rules tell it to fix the metadata instead. Copy them into Your instructions and change them for your projects.
Show the metadata rules
METADATA RULES FOR MULE 4 PROJECTS
Studio checks each sub-flow and each private flow by itself.
It does not know the payload, attributes or vars that the calling flow sets.
This gives DataWeave errors such as "Unable to resolve reference of: payload"
and "Property was not found in: Object".
These are metadata problems. They are not code problems.
1. Do not restructure flows to fix them.
Do not change sub-flows to flows. Do not move scripts to .dwl files.
Do not inline sub-flows. Do not change pom.xml.
None of these fix a metadata problem.
2. Put the metadata in these files:
- src/main/resources/application-types.xml
- src/main/resources/examples/*.json (one sample file per type)
3. Link a component to its metadata with a doc:id:
- Give the first component of the sub-flow a unique doc:id (UUID).
- Add <types:enrichment select="#<doc:id>"> in application-types.xml.
- Use the same id in both places.
- Inside it, use types:processor-declaration > types:input-event.
- Put payload and attributes in types:message
(types:payload type="X", types:attributes type="Y").
- Put variables in types:variables.
4. Define every type in types:catalog:
<types:type name="X" format="json">
<types:shape format="weave" example="examples/x.json"><![CDATA[%dw 2.0
type X = { ... }
]]></types:shape>
</types:type>
- Always write the DataWeave type inside types:shape.
- An example= attribute alone does not work.
- Make the type match the example file.
5. Variables:
<types:variable name="startedAt" type="PlaygroundStartedAt"/>
- Use name=, not key=.
- The type must be the name of a catalog type.
Built-in names such as Number and String do not resolve.
- For a simple value, make a catalog type, for example
type PlaygroundStartedAt = Number.
6. Work out the sample data from the code.
- Read the DataWeave in the sub-flow and the flows that call it.
- Find every field of payload, attributes and vars that the script uses.
- Put all of them in the types.
- Keep the types for the same variable consistent across all callers.
7. Errors show one layer at a time.
- When one layer is fixed, the next error can show.
- Read each new message and the stack trace.
- Stack trace "requireAttribute": an attribute is missing or has the wrong name.
- "Failed to resolve type X": the type is not in the catalog, or has no shape.
- Make the smallest change for each message.
8. Warnings "Auto-Coercing type from Any":
- Do not use "as Object".
- Use: payload.x match { case v is Object -> v else -> {} }
9. You cannot see what Studio writes.
- If you are not sure of a format, say so.
- Ask me to make one example in Studio and copy the file that it writes.
- Prefer that format to a format from memory.
10. After a metadata change, tell me to do these steps:
- Close and reopen the XML file.
- Run Project > Clean.
- Update Maven with Alt+F5.Next: discover Studio AI with your first flow.