---
title: "Test Model Connection"
method: POST
path: "/api/models/test-connection"
tags: ["models"]
---

# Test Model Connection

`POST /api/models/test-connection`

Test connection with provided model parameters before saving.

## Request body

- ModelConnectionTestRequest — Request schema for testing an unsaved model connection
  - `model_provider` string, required
  - `model_name` string, required
  - `api_key` string, nullable
  - `base_url` string, nullable
  - `category` string
  - `temperature` number, nullable
  - `dimension` integer, nullable
  - `abilities` string[], nullable
  - `top_n` integer, nullable
  - `instruct` string, nullable

## Response `200`

Successful Response

- ModelTestResponse — Model test response schema
  - `model_id` string, required
  - `status` string, required
  - `response_time` number, nullable, required
  - `message` string, nullable, required
  - `error` string, nullable, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/xorbitsai/apis/xagent.md) · [All operations](https://skmtc.net/xorbitsai/apis/xagent/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/xorbitsai/xagent/revisions/33e4ba4936ad/schema)
