The Ollama provider exposes two API surfaces: Chat Completions (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/phpaisdk/ollama/llms.txt
Use this file to discover all available pages before exploring further.
/chat/completions) and Responses (/responses). Both surfaces are OpenAI-compatible and support streaming and tool calling. Chat Completions is the default because it has broader documented support for Ollama-specific features — vision input, reasoning effort controls, and structured output. The Responses surface is available when you need it, but certain features that rely on Chat Completions request fields are intentionally blocked and will throw at request time.
Endpoint comparison
| Feature | Chat Completions | Responses |
|---|---|---|
| Default | ✓ | — |
| Streaming | ✓ | ✓ |
| Tool calling | ✓ | ✓ |
| Vision (image input) | ✓ | — (not documented) |
| Reasoning effort | ✓ (low, medium, high) | ✗ (throws) |
| Structured output | ✓ | ✗ (throws) |
| URL path | /chat/completions | /responses |
Global selection
Set the default API surface for every request made through the provider:Ollama::create().
Per-request override
Override the global default for a single request usingproviderOptions(). This does not affect other requests in the same process.
Per-request
providerOptions take precedence over the global api option set in Ollama::create(). The request-level value is resolved by OllamaApi::resolve() each time, so the same validation rules apply.OllamaApi enum
Internally, the provider maps string values to theOllamaApi enum via OllamaApi::resolve(). The two valid string values are:
chat_completions— maps toOllamaApi::ChatCompletionsresponses— maps toOllamaApi::Responses
Ollama::create() or as a per-request provider option — throws an InvalidArgumentException:
