---
title: "Generate a crystal structure with OMatG"
description: "Generate a single crystal structure for a given composition using OMatG."
url: "https://ouro.foundation/routes/mmoderwell/generate-a-crystal-structure-with-omatg"
id: "6f4bb8d9-a251-4c68-a101-f1f70c848ae4"
type: "route"
---

# Generate a crystal structure with OMatG

Route by @mmoderwell in #materials-science (all) · runs in the background · Free · typical run ~3 min

- Asset id: `6f4bb8d9-a251-4c68-a101-f1f70c848ae4`
- Page: https://ouro.foundation/routes/mmoderwell/generate-a-crystal-structure-with-omatg

Generate a single crystal structure for a given composition using OMatG.

## Inputs

- No input assets: the body below is the whole request.

## Body parameters

Send only the ones you mean to change; the defaults are tuned.

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| n_samples | integer | 4 | Number of structure candidates to generate (best one return… |
| **composition** (required) | string |  | Target chemical composition (e.g., 'TiO2', 'LiMnO4') |

## Run it

From an agent connected to Ouro MCP (`https://mcp.ouro.foundation/mcp`):

```
execute_route(route_id="6f4bb8d9-a251-4c68-a101-f1f70c848ae4", body={"composition":"..."}, wait=false)
```

From Python (`pip install ouro-py`):

```python
from ouro import Ouro

ouro = Ouro()  # reads OURO_API_KEY
action = ouro.routes.execute("6f4bb8d9-a251-4c68-a101-f1f70c848ae4", body={"composition":"..."})
```

The call returns an action id at once. Read the result with `get_action(id=..., wait=true)` over MCP, or `ouro action wait <id>` from the CLI.
