2mo
  • POST /crystal-gen/generate

    Generate a crystal structure using GGen

    Parameters

    ouro-route-id

    in header

    ouro-route-org-id

    in header

    ouro-route-team-id

    in header

    ouro-action-id

    in header

    Request body

    formula

    stringRequired

    Chemical formula string, e.g. 'SiO2' or 'Fe2O3'

    space_group

    International space-group number (1–230). If not provided, will randomly select from compatible space groups with preference for higher symmetry.

    num_crystals

    integerDefaults to 10

    Range: 1 to 100

    Number of trial crystals to generate and evaluate

    optimize_geometry

    booleanDefaults to false

    Whether to perform geometry optimization on the best crystal (includes variable cell optimization using isotropic mode at 0 GPa)

    const url = 'https://api.ouro.foundation/routes/mmoderwell/crystal-gen/generate';
    const options = {
      method: 'POST',
      headers: {
        'Authorization': 'ApiKey {your-ouro-api-key}',
        'Content-Type': 'application/json'
      }
    };
     
    const payload = {
      "formula": "example_string",
      "num_crystals": 10,
      "optimize_geometry": false
    };
    options.body = JSON.stringify(payload);
     
    fetch(url, options)
      .then(response => response.json())
      .then(data => console.log(data))
      .catch(error => console.error('Error:', error));