# Test connection to Ollama instance

**POST** `/v1/private/ollama/test-connection`

Validates that the provided Ollama URL is reachable. URL may be provided with or without /v1 suffix (e.g., http://localhost:11434 or http://localhost:11434/v1). The /v1 suffix will be automatically removed for connection testing. For inference, use the URL with /v1 suffix.

Base URL: `https://www.comet.com/opik/api`

Tags: `Ollama`

## Authorization

This operation requires no authorization.

## Request body

Required. Media type: `application/json`

### Example request body

```json
{
  "api_key": "",
  "base_url": "http://localhost:11434/v1"
}
```

## Responses

| Status | Description | Media type |
| --- | --- | --- |
| `200` | Connection test successful | `application/json` |
| `422` | Unprocessable Content - Invalid URL format | `application/json` |
| `502` | Connection test failed - Ollama instance unreachable | `application/json` |
| `503` | Ollama provider is disabled | `application/json` |

### Example response: 200 — Connection test successful

```json
{
  "connected": true,
  "error_message": "string",
  "version": "string"
}
```

### Example response: 422 — Unprocessable Content - Invalid URL format

```json
{
  "code": 0,
  "details": "string",
  "message": "string"
}
```

### Example response: 502 — Connection test failed - Ollama instance unreachable

```json
{
  "connected": true,
  "error_message": "string",
  "version": "string"
}
```

### Example response: 503 — Ollama provider is disabled

```json
{
  "code": 0,
  "details": "string",
  "message": "string"
}
```

## Related pages

- [Activate a pairing session](./activatepairingsession.md)
- [Add blueprint to existing config](./updateagentconfig.md)
- [Add items to annotation queue](./additemstoannotationqueue.md)
- [Add span comment](./addspancomment.md)
- [Add span feedback score](./addspanfeedbackscore.md)
- [Add thread comment](./addthreadcomment.md)
- [Add trace comment](./addtracecomment.md)
- [Add trace feedback score](./addtracefeedbackscore.md)
- [Agent Configs](./tags/agent-configs.md)
- [Agent Insights](./tags/agent-insights.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
