> For the complete documentation index, see [llms.txt](https://docs.apismart.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apismart.ai/troubleshooting/model-and-request-errors.md).

# Model and Request Errors

Model and request errors usually occur when the selected model, API endpoint, or request parameters do not match the requirements of the selected model.

Before troubleshooting, compare your request with the selected model’s **Code Example** and verify that all fields and values are supported.

For general API errors, see [**HTTP Status Codes and API Errors**](/troubleshooting/http-status-codes-and-api-errors.md).

***

### Check the Model ID

The **Model ID** must exactly match the value shown on the selected model’s details page.

Check:

* Model ID spelling
* Uppercase and lowercase characters
* Hyphens, underscores, and periods
* Whether the model is currently available

Example:

```
Correct:
model-name-v1

Incorrect:
Model-Name-V1
model_name_v1
```

Model IDs are case-sensitive and must be copied exactly.

***

### Common Model Errors

#### Model Not Found

A model not found error usually means:

* The Model ID is incorrect.
* The model name was copied incorrectly.
* The selected model is unavailable.
* The request uses a model ID from another provider.

Check the selected model’s **Code Example** and replace the Model ID with the exact value provided.

***

#### Unsupported Model

Some models support different capabilities.

For example:

| Model Type  | Supported Tasks         |
| ----------- | ----------------------- |
| Text Model  | Chat or text generation |
| Image Model | Image generation        |
| Video Model | Video generation        |

Using an image or video model with a Chat Completions request may result in an error.

Always use the endpoint and request format supported by the selected model.

***

### Check the API Endpoint

Make sure the endpoint matches the API you are using.

Examples:

```
Chat Completions:
POST /v1/chat/completions

Image Generation:
POST /v1/images/generations

Video Generation:
POST /v1/video/tasks
```

Common endpoint problems:

* Using the wrong API path
* Missing `/v1`
* Sending requests to an unsupported endpoint
* Using a Chat endpoint for image or video models

***

### Check Request Parameters

Request fields vary by model.

Do not assume parameters are interchangeable.

Common examples:

| Parameter       | Possible Variations             |
| --------------- | ------------------------------- |
| Text input      | `messages`, `prompt`, `content` |
| Image size      | `size`, `resolution`            |
| Video input     | `prompt`, `content`             |
| Output settings | Model-specific options          |

Always use the exact request structure shown in the selected model’s **Code Example**.

***

### Common Request Errors

#### 400 Bad Request

Usually caused by:

* Missing required fields
* Invalid JSON format
* Incorrect parameter names
* Unsupported parameter values

Check the request body and compare it with the model example.

***

#### Invalid Parameter Value

A request may fail when a parameter value is not supported.

Examples:

* Unsupported resolution
* Invalid duration
* Incorrect format
* Unsupported option

Do not modify parameter values unless they are listed as supported for the selected model.

***

#### Request Format Does Not Match the Model

Different models may require different request structures.

For example:

```json
{
  "prompt": "Generate an image"
}
```

and:

```json
{
  "content": [
    {
      "type": "text",
      "text": "Generate an image"
    }
  ]
}
```

may not be interchangeable.

Use the format shown in the selected model’s **Code Example**.

***

### Check Usage Logs

If a request fails:

1. Open **Usage Logs**.

<figure><img src="/files/ZIkcAcnUVNW7HNhkA7Yl" alt=""><figcaption></figcaption></figure>

2. Find the failed request.
3. Review:

* Request ID
* Model
* Status
* Error Message
* Request details

Use this information to identify whether the issue is related to the model, request format, or account configuration.

***

### When to Contact Support

Contact support if:

* The same valid request continues failing.
* The selected model example does not work.
* The error message is unclear.
* A model appears unavailable unexpectedly.

Include:

* Request ID
* Model ID
* API endpoint
* Request time
* HTTP status code
* Error message

Do not include:

* Full API Token
* Account password
* Payment information

> 🔐 Never provide your full API Token to support.

***

### 🚀 Next Steps

Continue with:

* [**Choose a Model and Find Its Model ID**](/models-and-pricing/models-and-model-ids.md)
* [**API Basics**](/api-guides/api-basics.md)
* [**HTTP Status Codes and API Errors**](/troubleshooting/http-status-codes-and-api-errors.md)
* [**Usage Logs and Costs**](/api-usage/usage-logs-and-costs.md)
* [**Balance and Usage Limit Issues**](/troubleshooting/balance-and-usage-limit-issues.md)
