> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.conductorquantum.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.conductorquantum.com/_mcp/server.

# Run Model

POST https://api.conductorquantum.com/v0/models
Content-Type: multipart/form-data

Analyze your input data using the specified model. Upload a NumPy array (`.npy`) as the data file and specify the model ID. For more information about available models and their capabilities, see our [overview](/control/models/overview).

This endpoint also supports the [Ising Decoding](/control/qec-decoding) models (`ising-decoding-v1-fast` and `ising-decoding-v1-accurate`) for AI-accelerated quantum error correction.


Reference: https://docs.conductorquantum.com/api-reference/control-api/models/run

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Body (multipart/form-data)

This endpoint expects a multipart form containing a file.

- `model` (string, required) — The model to run.
- `data` (file, required) — The data to analyse.

## Response

### 200

Successful Response

- `output` (map from string to any, required) — The output of the model
- `id` (string, required) — The external UUID of the model result
- `created_at` (string, required) — The UTC time the model result was created
- `input_file_name` (string, required) — The name of the input file
- `input_file_size` (integer, required) — The size of the input file in bytes
- `model` (string, required) — The string ID of the model
- `user_vote` (integer, optional, nullable) — Current user's vote: 1, -1, or null

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)

### ValidationErrorLocItems

## Examples

**Request**

```json
{
  "model": "string",
  "data": "<file: string>"
}
```

**Response**

```json
{
  "output": {
    "peak_indices": [
      10,
      20,
      30
    ]
  },
  "id": "08047949-7263-4557-9122-ab293a49cae5",
  "created_at": "2024-01-01T00:00:00",
  "input_file_name": "data.npy",
  "input_file_size": 123433,
  "model": "coulomb-blockade-peak-detector-v1"
}
```

**SDK Code**

```python models_run_example
from conductorquantum import ConductorQuantum

client = ConductorQuantum(
    token="YOUR_TOKEN",
)

with open("path/to/file.npy", "rb") as f:
    client.control.models.run(
        model="coulomb-blockade-peak-detector-v1",
        data=f,
    )

```

```javascript models_run_example
const url = 'https://api.conductorquantum.com/v0/models';
const form = new FormData();
form.append('model', 'string');
form.append('data', 'string');

const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

options.body = form;

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go models_run_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.conductorquantum.com/v0/models"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"data\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby models_run_example
require 'uri'
require 'net/http'

url = URI("https://api.conductorquantum.com/v0/models")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"data\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
```

```java models_run_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.conductorquantum.com/v0/models")
  .header("Authorization", "Bearer <token>")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"data\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n")
  .asString();
```

```php models_run_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.conductorquantum.com/v0/models', [
  'multipart' => [
    [
        'name' => 'model',
        'contents' => 'string'
    ],
    [
        'name' => 'data',
        'filename' => 'string',
        'contents' => null
    ]
  ]
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp models_run_example
using RestSharp;

var client = new RestClient("https://api.conductorquantum.com/v0/models");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"data\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift models_run_example
import Foundation

let headers = ["Authorization": "Bearer <token>"]
let parameters = [
  [
    "name": "model",
    "value": "string"
  ],
  [
    "name": "data",
    "fileName": "string"
  ]
]

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://api.conductorquantum.com/v0/models")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```