Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.
openapi: 3.2.0
info:
title: Opik REST Ollama API
description: The Opik REST API is currently in beta and subject to change.
contact:
name: Github Repository
url: https://github.com/comet-ml/opik
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
version: 1.0.0
servers:
- url: http://localhost:5173/api
description: Local server
- url: https://www.comet.com/opik/api
description: Opik Cloud
tags:
- name: Ollama
description: Ollama provider configuration endpoints with OpenAI-compatible API support.
paths:
/v1/private/ollama/models:
post:
tags:
- Ollama
summary: List available Ollama models
description: Fetches the list of models available from the Ollama instance. 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 model discovery. For actual LLM inference, use the URL with /v1 suffix for OpenAI-compatible endpoints.
operationId: listModels
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/OllamaInstanceBaseUrlRequest'
required: true
responses:
'200':
description: Models retrieved successfully
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/OllamaModel'
'422':
description: Unprocessable Content - Invalid URL format
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
'500':
description: Failed to fetch models
'503':
description: Ollama provider is disabled
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
/v1/private/ollama/test-connection:
post:
tags:
- Ollama
summary: Test connection to Ollama instance
description: 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.
operationId: testConnection
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/OllamaInstanceBaseUrlRequest'
required: true
responses:
'200':
description: Connection test successful
content:
application/json:
schema:
$ref: '#/components/schemas/OllamaConnectionTestResponse'
'422':
description: Unprocessable Content - Invalid URL format
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
'502':
description: Connection test failed - Ollama instance unreachable
content:
application/json:
schema:
$ref: '#/components/schemas/OllamaConnectionTestResponse'
'503':
description: Ollama provider is disabled
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
components:
schemas:
OllamaConnectionTestResponse:
type: object
properties:
connected:
type: boolean
description: Whether the connection was successful
version:
type: string
description: Server version (returned even if connection failed or version is incompatible)
error_message:
type: string
description: Error message if connection failed
description: Response from Ollama connection test.
OllamaInstanceBaseUrlRequest:
required:
- base_url
type: object
properties:
base_url:
minLength: 1
type: string
description: Base URL of the Ollama instance. May include /v1 suffix which will be automatically removed for connection testing. For inference, use the URL with /v1 suffix for OpenAI-compatible endpoints.
example: http://localhost:11434/v1
api_key:
type: string
description: Optional API key for authenticated Ollama instances. If provided, will be sent as Bearer token in Authorization header.
description: Request with Ollama instance base URL for connection testing or model discovery.
ErrorMessage:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
details:
type: string
OllamaModel:
required:
- name
type: object
properties:
name:
minLength: 1
type: string
description: Model name
example: llama2
size:
type: integer
description: Model size in bytes
format: int64
digest:
type: string
description: Model digest/hash
modified_at:
type: string
description: Model modification date
format: date-time
description: Ollama model information