# Load Output Cases

Loads output cases into a project in globalMOO.

## Endpoint

`POST /models/{model_id}/projects/{project_id}/output-cases`

## Path Parameters

| Parameter   | Type    | Required | Description       |
| ----------- | ------- | -------- | ----------------- |
| model\_id   | integer | Yes      | ID of the model   |
| project\_id | integer | Yes      | ID of the project |

## Request Parameters

| Parameter   | Type                  | Required | Description                                     |
| ----------- | --------------------- | -------- | ----------------------------------------------- |
| outputCount | integer               | Yes      | Number of outputs per case (must be > 0)        |
| outputCases | array\[array\[float]] | Yes      | Array of output case arrays (must be non-empty) |

## Request Format

```json
{
    "outputCount": 3,
    "outputCases": [
        [1.2, 3.4, 5.6],
        [7.8, 9.0, 1.2],
        [3.4, 5.6, 7.8]
    ]
}
```

## Response Fields

| Field         | Type                  | Description                          |
| ------------- | --------------------- | ------------------------------------ |
| id            | integer               | Unique identifier for the output set |
| model\_id     | integer               | ID of the model                      |
| project\_id   | integer               | ID of the project                    |
| output\_count | integer               | Number of outputs per case           |
| output\_cases | array\[array\[float]] | Array of output case arrays          |
| created\_at   | string                | Creation timestamp (ISO 8601)        |
| updated\_at   | string                | Last update timestamp (ISO 8601)     |

## Response Format

```json
{
    "id": 123,
    "model_id": 456,
    "project_id": 789,
    "output_count": 3,
    "output_cases": [
        [1.2, 3.4, 5.6],
        [7.8, 9.0, 1.2],
        [3.4, 5.6, 7.8]
    ],
    "created_at": "2025-01-31T10:00:00.000Z",
    "updated_at": "2025-01-31T10:00:00.000Z"
}
```

## Examples

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

```python
from globalmoo import Client

client = Client(api_key="your-api-key")
result = client.load_output_cases(
    model_id=123,
    project_id=456,
    output_count=3,
    output_cases=[
        [1.2, 3.4, 5.6],
        [7.8, 9.0, 1.2],
        [3.4, 5.6, 7.8]
    ]
)
```

{% endtab %}

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

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

const client = new Client('your-api-key');
const result = await client.loadOutputCases({
    modelId: 123,
    projectId: 456,
    outputCount: 3,
    outputCases: [
        [1.2, 3.4, 5.6],
        [7.8, 9.0, 1.2],
        [3.4, 5.6, 7.8]
    ]
});
```

{% endtab %}

{% tab title="PHP" %}

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

$result = $client->loadOutputCases([
    "modelId" => 123,
    "projectId" => 456,
    "outputCount" => 3,
    "outputCases" => [
        [1.2, 3.4, 5.6],
        [7.8, 9.0, 1.2],
        [3.4, 5.6, 7.8]
    ]
]);
```

{% endtab %}
{% endtabs %}

## Error Responses

| Status Code | Description                                  |
| ----------- | -------------------------------------------- |
| 400         | Invalid request - Invalid output data format |
| 401         | Unauthorized - Invalid API key               |
| 404         | Model or project not found                   |
| 429         | Too many requests - Rate limit exceeded      |
| 500         | Internal server error                        |

## Validation Rules

* Model and project IDs must be positive integers
* outputCount must be a positive integer
* Each output case must contain exactly outputCount values
* All output values must be valid floating point numbers
* The output cases array must contain at least one case
* Project must exist and be active
