> ## Documentation Index
> Fetch the complete documentation index at: https://docs.logic.inc/llms.txt
> Use this file to discover all available pages before exploring further.

# Model Override

> How to specify a custom model when executing an agent

## Model Override

By default, Logic automatically routes your agent execution to the optimal model based on your agent's requirements. However, you can bypass this routing and explicitly specify which model and reasoning level to use by adding the `model` query parameter.

<Warning>
  Model overrides are an advanced feature. In most cases, Logic's automatic
  model routing will select the best model for your use case. Only use model
  overrides when you have specific requirements around model selection.
</Warning>

## Available Models

The `model` parameter accepts a model identifier in the format `{model}:{reasoning_level}`.

| Provider       | Model Overrides                                                                                        |
| -------------- | ------------------------------------------------------------------------------------------------------ |
| OpenAI GPT-5.1 | `gpt-5.1:none`, `gpt-5.1:minimal`, `gpt-5.1:low`, `gpt-5.1:medium`, `gpt-5.1:high`                     |
| OpenAI GPT-5.2 | `gpt-5.2:none`, `gpt-5.2:minimal`, `gpt-5.2:low`, `gpt-5.2:medium`, `gpt-5.2:high`                     |
| OpenAI GPT-5.4 | `gpt-5.4:none`, `gpt-5.4:minimal`, `gpt-5.4:low`, `gpt-5.4:medium`, `gpt-5.4:high`                     |
| OpenAI GPT-5.5 | `gpt-5.5:none`, `gpt-5.5:minimal`, `gpt-5.5:low`, `gpt-5.5:medium`, `gpt-5.5:high`                     |
| Gemini 3 Flash | `gemini-3-flash:default`, `gemini-3-flash:low`, `gemini-3-flash:medium`, `gemini-3-flash:high`         |
| Gemini 3.1 Pro | `gemini-3.1-pro:default`, `gemini-3.1-pro:low`, `gemini-3.1-pro:high`                                  |
| Groq           | `groq-gpt-oss:default`                                                                                 |
| Cerebras       | `cerebras-gpt-oss:default`, `cerebras-gpt-oss:low`, `cerebras-gpt-oss:medium`, `cerebras-gpt-oss:high` |

### Reasoning Levels

The reasoning level controls how much "thinking" the model does before responding:

* **none/default** — Standard response without extended reasoning
* **minimal** — Light reasoning for simple tasks
* **low** — Basic reasoning for straightforward problems
* **medium** — Moderate reasoning for complex tasks
* **high** — Maximum reasoning for the most challenging problems

<Note>
  Higher reasoning levels may increase latency and cost but can improve accuracy
  for complex tasks.
</Note>

## Capability Validation

When using a model override, Logic validates that your chosen model supports your agent's requirements. If your agent requires capabilities the model doesn't support, you'll receive a `400 InvalidModelOverride` error.

| Capability       | OpenAI        | Gemini        | Groq          | Cerebras      |
| ---------------- | ------------- | ------------- | ------------- | ------------- |
| PDF Processing   | Supported     | Supported     | Not supported | Not supported |
| Office Documents | Supported     | Supported     | Not supported | Not supported |
| Image Processing | Supported     | Supported     | Not supported | Not supported |
| Audio Processing | Not supported | Supported     | Not supported | Not supported |
| HIPAA Compliance | Not supported | Supported     | Not supported | Not supported |
| Tool Usage       | Supported     | Not supported | Supported     | Supported     |

For example, if your agent processes audio input and you specify `?model=gpt-5.1:low`, the request will fail because OpenAI models don't support audio processing.

## Example Usage

Below are examples showing how to specify a model override when executing an agent.

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST 'https://api.logic.inc/v1/agents/{agent_id}/executions?model=gpt-5.1:low'
      -H "Authorization: Bearer $LOGIC_API_TOKEN"
      -H "Content-Type: application/json"
      -d '{
          /* your input JSON here */
      }'
  ```

  ```bash httpie theme={null}
  http -A bearer -a $LOGIC_API_TOKEN POST 'https://api.logic.inc/v1/agents/{agent_id}/executions?model=gpt-5.1:low'
      --raw '{
        {YOUR INPUT JSON HERE}
      }'
  ```

  ```python python theme={null}
  import requests

  LOGIC_API_TOKEN = "ls-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

  headers = {
      "Authorization": f"Bearer {LOGIC_API_TOKEN}",
      "Content-Type": "application/json"
  }

  response = requests.post(
      "https://api.logic.inc/v1/agents/{agent_id}/executions?model=gpt-5.1:low",
      headers=headers,
      json={
          # Your input fields here
      }
  )

  print(response.json())
  ```

  ```ruby ruby theme={null}
  require 'net/http'
  require 'json'

  uri = URI('https://api.logic.inc/v1/agents/{agent_id}/executions?model=gpt-5.1:low')
  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = uri.scheme == 'https'

  LOGIC_API_TOKEN = 'ls-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
  request = Net::HTTP::Post.new(uri)
  request['Authorization'] = "Bearer #{LOGIC_API_TOKEN}"
  request['Content-Type'] = 'application/json'
  request.body = '{
    /* your input here */
  }'

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

  ```javascript javascript theme={null}
  const LOGIC_API_TOKEN = "ls-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";

  const response = await fetch(
    "https://api.logic.inc/v1/agents/{agent_id}/executions?model=gpt-5.1:low",
    {
      method: "POST",
      headers: {
        Authorization: `Bearer ${LOGIC_API_TOKEN}`,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        // Your input fields here
      }),
    },
  );

  const data = await response.json();
  console.log(data);
  ```

  ```go go theme={null}
  package main

  import (
      "bytes"
      "encoding/json"
      "fmt"
      "net/http"
      "io/ioutil"
  )

  const (
      LOGIC_API_TOKEN = "ls-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  )

  func main() {
      jsonStr := `{
        {YOUR INPUT JSON HERE}
      }`

      // Create request
      req, err := http.NewRequest("POST", "https://api.logic.inc/v1/agents/{agent_id}/executions?model=gpt-5.1:low", bytes.NewBufferString(jsonStr))
      if err != nil {
          panic(err)
      }

      // Add headers
      req.Header.Set("Content-Type", "application/json")
      req.Header.Set("Authorization", "Bearer " + LOGIC_API_TOKEN)

      // Send request
      client := &http.Client{}
      resp, err := client.Do(req)
      if err != nil {
          panic(err)
      }
      defer resp.Body.Close()

      // Read response
      body, err := ioutil.ReadAll(resp.Body)
      if err != nil {
          panic(err)
      }

      fmt.Println(string(body))
  }
  ```

  ```java java theme={null}
  // Java requires the OkHttp library. You can add it to your project using Maven or Gradle. Learn more in the Java Quick Start section of the API reference.


  import okhttp3.*;
  import java.io.IOException;

  public class ApiClient {
      private static final String LOGIC_API_TOKEN = "ls-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";

      public static void main(String[] args) {
          OkHttpClient client = new OkHttpClient();


          MediaType JSON = MediaType.get("application/json; charset=utf-8");
          String jsonBody = """
          {
              // Your input fields here
          }
          """;

          RequestBody body = RequestBody.create(jsonBody, JSON);
          Request request = new Request.Builder()
              .url("https://api.logic.inc/v1/agents/{agent_id}/executions?model=gpt-5.1:low")
              .post(body)
              .addHeader("Authorization", "Bearer " + LOGIC_API_TOKEN)

              .addHeader("Content-Type", "application/json")
              .build();

          try (Response response = client.newCall(request).execute()) {
              String responseBody = response.body().string();
              System.out.println(responseBody);
          } catch (IOException e) {
              e.printStackTrace();
          }
      }
  }
  ```
</CodeGroup>

<replaceID />

## Error Handling

If you specify an invalid model or a model that doesn't support your agent's requirements, you'll receive a `400 InvalidModelOverride` error:

```json theme={null}
{
  "error": {
    "code": "InvalidModelOverride",
    "message": "The specified model 'gpt-5.1:low' does not support audio processing required by this agent"
  }
}
```
