> For the complete documentation index, see [llms.txt](https://docs.m-xr.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.m-xr.com/marso-studio/integrations/your-own-code.md).

# Your own code (API)

Marso Studio exposes an API so you can call its generation capabilities from your own tools. Endpoints are available to authenticated users — you authenticate with an **API key** that you create in the app.

The API, and creating a key, need a paid plan or the trial. On the Free plan, **Create Key** is locked and **API Keys** shows *Your plan does not include API access.* A key you made during the trial stops working when the trial ends, and works again after you upgrade. See [Plans](https://docs.m-xr.com/marso-studio/reference/credits-and-billing.md#plans).

### Creating an API key

1. Log in to Marso Studio.
2. Open **API Keys** in the left sidebar.
3. Under **New Key**, give your key a name and click **Create Key**.
4. **Copy the key straight away and store it somewhere safe — it is shown only once.**

> **Keep your key secret.** Treat it like a password: never commit it to source control, share it, or expose it in client-side code. If a key is ever exposed, revoke it immediately.

### Managing keys

* **Revoke** a key to stop it working immediately.
* **Delete** keys you no longer need.

You can create multiple keys — for example, one per integration — and revoke them independently.

### Using the API

The endpoints, request examples and the full reference are in the [Marso Studio API docs](https://docs.m-xr.com/marso-studio-api/getting-started/introduction). In the app, **API Docs** in the left sidebar opens them too.

To make a material from an image, including a tileable one, see [Make a material from an image](https://docs.m-xr.com/marso-studio/reference/make-a-material-from-an-image.md#from-the-api).

To guide a 3D model's materials with an image of yours, send `conditioning_image_asset_id` with `POST /pbr/execute/mesh`. See [Generate PBR Textures](https://docs.m-xr.com/marso-studio/reference/nodes-reference.md#generate-pbr-textures).

### Marso MCP

To let an AI agent such as Claude, ChatGPT, Codex or Claude Code use Marso Studio for you, connect it to Marso MCP. It needs an API key too, so it needs a paid plan or the trial as well. See [AI chat](https://docs.m-xr.com/marso-studio/integrations/ai-chat.md).

### Credits

API generations spend credits from the same balance as the app, at the same rates. See [Credits & billing](https://docs.m-xr.com/marso-studio/reference/credits-and-billing.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.m-xr.com/marso-studio/integrations/your-own-code.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
