For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Copy to LLMGithubGo to App
DocumentationIntegrationsBuilding Self-Improving AgentsSelf-hosting OpikSDK & API reference
DocumentationIntegrationsBuilding Self-Improving AgentsSelf-hosting OpikSDK & API reference
    • Overview
  • Python SDK
    • Reference
    • REST API Client
  • Typescript SDK
    • Overview
    • Opik TS
    • Prompts
    • Opik Query Language (OQL)
  • Rest API
    • Overview
        • POSTList available Ollama models
        • POSTTest connection to Ollama instance
LogoLogo
Copy to LLMGithubGo to App
Rest APIAPI ReferenceOllama

List available Ollama models

POST
/v1/private/ollama/models
POST
/api/v1/private/ollama/models
$curl -X POST http://localhost:5173/api/v1/private/ollama/models \
> -H "Content-Type: application/json" \
> -d '{
> "base_url": "http://localhost:11434/v1"
>}'
1[
2 {
3 "name": "llama2",
4 "size": 1,
5 "digest": "string",
6 "modified_at": "2024-01-15T09:30:00Z"
7 }
8]
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.
Was this page helpful?
Previous

Test connection to Ollama instance

Next
Built with

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

This endpoint expects an object.
base_urlstringRequired>=1 character

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.

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

Response

Models retrieved successfully
namestring>=1 character
Model name
sizelong
Model size in bytes
digeststring

Model digest/hash

modified_atdatetime
Model modification date

Errors

422
Unprocessable Entity Error
500
Internal Server Error
503
Service Unavailable Error