> For the complete documentation index, see [llms.txt](https://globalmoo.gitbook.io/globalmoo-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://globalmoo.gitbook.io/globalmoo-documentation/endpoints/models/create.md).

# Create Model

Creates a new optimization model in globalMOO.

## Endpoint

`POST /models`

## Request Parameters

| Parameter   | Type   | Required | Description                                       |
| ----------- | ------ | -------- | ------------------------------------------------- |
| name        | string | Yes      | Name of the model (4-96 characters)               |
| description | string | No       | Optional description of the model (≥8 characters) |

## Request Format

```json
{
    "name": "string",
    "description": "string"
}
```

## Response Format

```json
{
    "id": "string",
    "name": "string",
    "description": "string",
    "created_at": "string",
    "updated_at": "string"
}
```

## Examples

{% tabs %}
{% tab title="Python" %}

```python
from globalmoo import Client

client = Client(api_key="your-api-key")
model = client.create_model(
    name="Optimization Model A",
    description="A model for optimizing process parameters"
)
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
const { Client } = require('globalmoo');

const client = new Client('your-api-key');
const model = await client.createModel({
    name: "Optimization Model A",
    description: "A model for optimizing process parameters"
});
```

{% endtab %}

{% tab title="PHP" %}

```php
$client = new Client("your-api-key");

$model = $client->createModel([
    "name" => "Optimization Model A",
    "description" => "A model for optimizing process parameters"
]);
```

{% endtab %}
{% endtabs %}

## Response Example

```json
{
    "id": 123,
    "name": "Optimization Model A",
    "description": "A model for optimizing process parameters",
    "created_at": "2025-01-31T10:00:00Z",
    "updated_at": "2025-01-31T10:00:00Z"
}
```

## Error Responses

| Status Code | Description                                                 |
| ----------- | ----------------------------------------------------------- |
| 400         | Invalid request - Missing required fields or invalid format |
| 401         | Unauthorized - Invalid API key                              |
| 429         | Too many requests - Rate limit exceeded                     |
| 500         | Internal server error                                       |

## Notes

* Model names must be unique within your account
* Description, if provided, must be at least 8 characters
* Model IDs are automatically generated and returned in the response
