---
updatedAt: 2026-05-04T21:43:38.000Z
agentTools:
  projectIndex: https://docs.toqua.ai/llms.txt
---

# Start a grid creation job

Used for routing.

Start an asynchronous job to create either a single end-to-end grid, or three grids: one per subrelation. Each grid dimension  is specified by a set of parameter values. Once the job is finished, a file containing the grids can be retrieved from the file endpoint. The maximum grid size is 5000000 rows.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Toqua API",
    "contact": {
      "name": "Toqua",
      "url": "https://toqua.ai/",
      "email": "admin@toqua.ai"
    },
    "version": "0.26"
  },
  "servers": [
    {
      "url": "https://api.toqua.ai",
      "description": "Toqua API"
    }
  ],
  "paths": {
    "/ships/{imo_number}/models/{model_version}/grid": {
      "post": {
        "tags": [
          "Models"
        ],
        "summary": "Start a grid creation job",
        "description": "Used for routing.\n\nStart an asynchronous job to create either a single end-to-end grid, or three grids: one per subrelation. Each grid dimension  is specified by a set of parameter values. Once the job is finished, a file containing the grids can be retrieved from the file endpoint. The maximum grid size is 5000000 rows.",
        "operationId": "create_grid",
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "imo_number",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Imo Number"
            }
          },
          {
            "name": "model_version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Set to 'latest' to use the default model version",
              "title": "Model Version"
            },
            "description": "Set to 'latest' to use the default model version"
          },
          {
            "name": "model_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "",
              "title": "Model Type"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModelGridSpecification"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelGridJobStatus"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "501": {
            "description": "Not Implemented"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "ModelGridJobStatus": {
        "properties": {
          "job_id": {
            "type": "string",
            "title": "Job ID",
            "description": "Unique ID of the job."
          },
          "creation_date": {
            "type": "string",
            "title": "Creation date",
            "description": "The date and time on which the job was created.",
            "examples": [
              "2022-08-02T09:21:24+00:00"
            ]
          },
          "grid_size": {
            "type": "integer",
            "title": "Total grid size",
            "examples": [
              184000
            ]
          },
          "specification": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ModelGridSpecification"
              },
              {
                "type": "null"
              }
            ],
            "title": "Grid specification",
            "description": "The grid specification provided to this grid creation job."
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "in_progress",
              "error",
              "completed"
            ],
            "title": "Status",
            "description": "Current status of the job."
          },
          "completion_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completion date",
            "description": "The date and time on which the job was completed.",
            "examples": [
              "2022-08-02T09:31:24+00:00"
            ]
          },
          "estimated_completion_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Estimated date of completion",
            "description": "An estimation of the date and time on which the job will be completed.",
            "examples": [
              "2022-08-02T09:35:24+00:00"
            ]
          }
        },
        "type": "object",
        "required": [
          "job_id",
          "creation_date",
          "grid_size",
          "status"
        ],
        "title": "ModelGridJobStatus"
      },
      "ModelGridParameters": {
        "properties": {
          "sog": {
            "anyOf": [
              {
                "items": {
                  "type": "number",
                  "minimum": 0
                },
                "type": "array",
                "minItems": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Speed Over Ground",
            "description": "List of Speed Over Ground values in knots (kn).",
            "examples": [
              10,
              11,
              12,
              13,
              14,
              15,
              16
            ]
          },
          "me_power": {
            "anyOf": [
              {
                "items": {
                  "type": "number",
                  "minimum": 0
                },
                "type": "array",
                "minItems": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Main Engine Power",
            "description": "List of Main Engine Power values in kilowatt (kW).",
            "examples": [
              1000,
              3000,
              6000,
              9000
            ]
          },
          "stw": {
            "anyOf": [
              {
                "items": {
                  "type": "number",
                  "minimum": 0
                },
                "type": "array",
                "minItems": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Speed Through Water",
            "description": "List of Speed Through Water values in knots (kn).",
            "examples": [
              14.1,
              15
            ]
          },
          "me_rpm": {
            "anyOf": [
              {
                "items": {
                  "type": "number",
                  "minimum": 0
                },
                "type": "array",
                "minItems": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Main Engine Shaft RPM",
            "description": "List of main engine shaft RPM values in Rotations Per Minute (RPM).",
            "examples": [
              60,
              61
            ]
          },
          "me_fo_consumption": {
            "anyOf": [
              {
                "items": {
                  "type": "number",
                  "minimum": 0
                },
                "type": "array",
                "minItems": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Main Engine Fuel Oil Consumption",
            "description": "List of main engine fuel oil consumption values in metric tons/day (mt/day).",
            "examples": [
              25.3,
              26
            ]
          },
          "draft_avg": {
            "items": {
              "type": "number",
              "minimum": 0
            },
            "type": "array",
            "minItems": 1,
            "title": "Average Draft",
            "description": "List of average draft values in meter (m).",
            "examples": [
              8
            ]
          },
          "trim": {
            "anyOf": [
              {
                "items": {
                  "type": "number"
                },
                "type": "array",
                "minItems": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Trim",
            "description": "List of trim values in meter (m). Calculated as draft fore - draft aft.",
            "examples": [
              -1
            ]
          },
          "wave_direction": {
            "items": {
              "type": "number",
              "maximum": 360,
              "minimum": 0
            },
            "type": "array",
            "maximum": 360,
            "minimum": 0,
            "minItems": 1,
            "title": "Wave Direction",
            "description": "List of directions from which the waves are coming, in degrees true (°T): north is at 0° and increases clockwise.",
            "examples": [
              0,
              90,
              180
            ]
          },
          "wave_height": {
            "items": {
              "type": "number",
              "minimum": 0
            },
            "type": "array",
            "minItems": 1,
            "title": "Significant Wave Height",
            "description": "List of significant wave heights in meter (m).",
            "examples": [
              0,
              1,
              2,
              3,
              4,
              5,
              6
            ]
          },
          "wave_period": {
            "anyOf": [
              {
                "items": {
                  "type": "number",
                  "minimum": 0
                },
                "type": "array",
                "minItems": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Wave Period",
            "description": "List of wave periods, in seconds (s).",
            "examples": [
              10
            ]
          },
          "current_speed": {
            "items": {
              "type": "number",
              "minimum": 0
            },
            "type": "array",
            "minItems": 1,
            "title": "Current Speed",
            "description": "List of current speed values in meter/second (m/s).",
            "examples": [
              0,
              0.5,
              1
            ]
          },
          "current_direction": {
            "items": {
              "type": "number",
              "maximum": 360,
              "minimum": 0
            },
            "type": "array",
            "maximum": 360,
            "minimum": 0,
            "minItems": 1,
            "title": "Current Direction",
            "description": "List of directions from which the currents are coming, in degrees true (°T): north is at 0° and increases clockwise.",
            "examples": [
              0,
              90,
              180
            ]
          },
          "wind_direction": {
            "items": {
              "type": "number",
              "maximum": 360,
              "minimum": 0
            },
            "type": "array",
            "minItems": 1,
            "title": "Wind Direction",
            "description": "List of directions from which the wind is coming, in degrees true (°T): north is at 0° and increases clockwise.",
            "examples": [
              0,
              90,
              180
            ]
          },
          "wind_speed": {
            "items": {
              "type": "number",
              "minimum": 0
            },
            "type": "array",
            "minItems": 1,
            "title": "Wind Speed",
            "description": "List of wind speed values in meter/seconds (m/s).",
            "examples": [
              0,
              5,
              10,
              15,
              20,
              25
            ]
          },
          "sea_surface_temperature": {
            "anyOf": [
              {
                "items": {
                  "type": "number"
                },
                "type": "array",
                "minItems": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Sea Surface Temperature",
            "description": "List of sea surface temperatures in degrees Celcius (°C).",
            "examples": [
              20
            ]
          },
          "sea_surface_salinity": {
            "anyOf": [
              {
                "items": {
                  "type": "number",
                  "minimum": 0
                },
                "type": "array",
                "minItems": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Sea Surface Salinity",
            "description": "List of sea surface salinities in Practical Salinity Units (PSU).",
            "examples": [
              35
            ]
          },
          "fuel_specific_energy": {
            "items": {
              "type": "number",
              "minimum": 0
            },
            "type": "array",
            "minItems": 1,
            "title": "Fuel Specific Energy",
            "description": "List of Fuel Specific Energy values in megajoule/kilogram (MJ/kg).",
            "examples": [
              40.1
            ]
          }
        },
        "type": "object",
        "required": [
          "draft_avg",
          "wave_direction",
          "wave_height",
          "current_speed",
          "current_direction",
          "wind_direction",
          "wind_speed",
          "fuel_specific_energy"
        ],
        "title": "ModelGridParameters"
      },
      "ModelGridSpecification": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description",
            "description": "Optional text that describes the characteristics of this grid.",
            "examples": [
              "High resolution table modelling performance on 14/05/2022."
            ]
          },
          "date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date",
            "description": "Specifies on which date the vessel's performance should be modelled. If left out, the most recent available date is used. If the date falls outside of the modelled range, a 400 error is returned.",
            "examples": [
              "2022-08-02T09:21:24+00:00"
            ]
          },
          "multi_grid": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Multi grid",
            "description": "Specifies whether to split the work of creating the grid into a separate grid for each subrelation. This decreases the processing time and table data size, at the expense of accuracy.",
            "default": true
          },
          "grid": {
            "$ref": "#/components/schemas/ModelGridParameters",
            "title": "Grid description",
            "description": "Description of the values to be used for creating the grid. The resulting N-dimensional grid will be constructed as the combination between all provided ranges. Example: if the range of wind direction should be [0:180:45] (using [min:max:step] notation), then the value given to `wind_direction` should be [0, 45, 90, 135, 180]. If multi_grid is False, only 'sog' may be provided, else ('sog', 'stw' and 'me_power') must be provided."
          }
        },
        "type": "object",
        "required": [
          "grid"
        ],
        "title": "ModelGridSpecification"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    },
    "securitySchemes": {
      "APIKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      },
      "HTTPBearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "externalDocs": {
    "description": "API Documentation",
    "url": "https://docs.toqua.ai"
  }
}
```