Skip to main content
Opik Documentation

Search documentation

Type to search this documentation.

List available Ollama models

POST/v1/private/ollama/modelsList available Ollama models

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.

Request body

required
application/json
objectOllamaInstanceBaseUrlRequest

Request with Ollama instance base URL for connection testing or model discovery.

api_keystring

Optional API key for authenticated Ollama instances. If provided, will be sent as Bearer token in Authorization header.

base_urlstringrequired

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.

minLength 1

Example request
{
  "api_key": "",
  "base_url": "http://localhost:11434/v1"
}

Responses

200Models retrieved successfullyapplication/json
array of object
Show array items

Ollama model information

digeststring

Model digest/hash

modified_atstring · date-time

Model modification date

namestringrequired

Model name

minLength 1

sizeinteger · int64

Model size in bytes

Example response
[
  {
    "digest": "string",
    "modified_at": "2026-06-09T00:00:00Z",
    "name": "llama2",
    "size": 0
  }
]
422Unprocessable Content - Invalid URL formatapplication/json
objectErrorMessage
codeinteger · int32
detailsstring
messagestring
Example response
{
  "code": 0,
  "details": "string",
  "message": "string"
}
500Failed to fetch models
503Ollama provider is disabledapplication/json
objectErrorMessage
codeinteger · int32
detailsstring
messagestring
Example response
{
  "code": 0,
  "details": "string",
  "message": "string"
}
Documentation menu