---
title: "Generate crystal structures with MatterGen"
description: "Generate a batch of candidate inorganic crystal structures for a target chemical system such as or . MatterGen samples structures consistent with the requested element set and returns a ZIP archive of CIF files. Use to control how many candidates to generate and to trade off conditioning strength ag"
url: "https://ouro.foundation/routes/mmoderwell/generate-crystal-structures-with-mattergen"
id: "9f920d84-2a88-4072-9ba5-3b4ce9ec0fe7"
type: "route"
---

# Generate crystal structures with MatterGen

Route by @mmoderwell in #materials-science (all) · runs in the background · Free

- Asset id: `9f920d84-2a88-4072-9ba5-3b4ce9ec0fe7`
- Page: https://ouro.foundation/routes/mmoderwell/generate-crystal-structures-with-mattergen

Generate a batch of candidate inorganic crystal structures for a target chemical system such as `Li-O` or `Fe-Co-Ni`. MatterGen samples structures consistent with the requested element set and returns a ZIP archive of CIF files. Use `batch_size` to control how many candidates to generate and `guidance_factor` to trade off conditioning strength against diversity.

## 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 |
| --- | --- | --- | --- |
| batch_size | integer | 8 | Number of structures to generate in each batch |
| **chemical_system** (required) | string |  | Chemical system to generate (e.g., 'Li-O' or 'Fe-Co-Ni') |
| guidance_factor | number | 2 | Diffusion guidance factor. Higher values produce samples th… |

## Run it

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

```
execute_route(route_id="9f920d84-2a88-4072-9ba5-3b4ce9ec0fe7", body={"chemical_system":"..."}, wait=false)
```

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

```python
from ouro import Ouro

ouro = Ouro()  # reads OURO_API_KEY
action = ouro.routes.execute("9f920d84-2a88-4072-9ba5-3b4ce9ec0fe7", body={"chemical_system":"..."})
```

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.
