> ## Documentation Index
> Fetch the complete documentation index at: https://hastekit.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Models and providers

> Configure a provider once and reuse its model for agents or direct model requests.

`hastekit.NewLLMClient` holds provider configuration. `client.Model("Provider/model")` selects a provider/model pair implementing the model API. Reuse that value in `AgentConfig.LLM` or call it directly.

With credentials in your environment:

```go theme={null}
client := hastekit.NewLLMClient([]hastekit.ProviderConfig{{
    ProviderName: hastekit.ProviderOpenAI,
    ApiKeys: []*hastekit.APIKeyConfig{{
        Name: "primary", APIKey: os.Getenv("OPENAI_API_KEY"),
    }},
}})
model := client.Model("OpenAI/gpt-4.1-mini")
```

See [providers and keys](/docs/hastekit-sdk/multiple-keys) for multiple credentials, custom base URLs, and provider middleware. Supported operations differ by adapter and model; a shared request field does not imply universal support.

## Choose an API

| Need | Guide |
| - | - |
| Agent tool loop | [Agents and execution](/docs/hastekit-sdk/agents/simple-agent) |
| Text and streaming | [Text generation](/docs/hastekit-sdk/responses/text-generation) |
| JSON constrained by a schema | [Structured output](/docs/hastekit-sdk/responses/structured-output) |
| Application-controlled tool loop | [Direct function calling](/docs/hastekit-sdk/responses/tool-calling) |
| Reasoning configuration | [Reasoning controls](/docs/hastekit-sdk/responses/reasoning) |
| Images and vision | [Images](/docs/hastekit-sdk/responses/image-generation) |
| Vector representations | [Embeddings](/docs/hastekit-sdk/embeddings/embeddings) |
| Audio output and input | [Speech](/docs/hastekit-sdk/speech/speech), [transcription](/docs/hastekit-sdk/speech/transcription) |

Provider-hosted [web search](/docs/hastekit-sdk/responses/web-search-tool) and [code execution](/docs/hastekit-sdk/responses/code-execution-tool) are separate from Go function tools and SDK sandbox tools. Their availability and billing belong to the selected provider.

For agent-specific retry budgets and fallback targets, use [agent resilience middleware](/docs/hastekit-sdk/agents/retries). For exact request shapes, see the [model API reference](/docs/hastekit-sdk/responses/responses-api).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.