> For the complete documentation index, see [llms.txt](https://docs.tonic.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tonic.ai/textual/textual-install-administer/configuring-textual/enable-and-configure-textual-features/configuring-connections-to-llm-providers.md).

# Configuring connections to LLM providers

For each provider that you use, either as the [default provider](/textual/textual-install-administer/configuring-textual/enable-and-configure-textual-features/configuring-the-default-llm-provider-and-model.md) or the configured provider for a specific feature, you configure the connection information.

## Amazon Bedrock

### Recommended models <a href="#bedrock-recommended-models" id="bedrock-recommended-models"></a>

For Amazon Bedrock, you provide the name of an Anthropic Claude model on Amazon Bedrock.

To enable cross-Region inference, we strongly recommend the `global.` prefix for model identifiers. For more information, go to [Claude on Amazon Bedrock](https://docs.anthropic.com/en/api/claude-on-amazon-bedrock).

* `global.anthropic.claude-opus-4-5-20251101-v1:0` - Recommended. Highest quality, although slowest and most expensive.
* `global.anthropic.claude-sonnet-4-5-20250929-v1:0` - Cheaper. Good but inconsistent quality.
* `global.anthropic.claude-haiku-4-5-20251001-v1:0` - Cheapest and fastest option.

To list all of the available Anthropic models in your AWS Region:

{% code overflow="wrap" %}

```
aws bedrock list-foundation-models \
  --by-provider Anthropic \
  --region us-west-2 \
  --query "modelSummaries[*].modelId"
```

{% endcode %}

Note that before they can be used, some models might require that you request access through the Amazon Bedrock console.

### Setting the AWS Region and token limit <a href="#bedrock-region-token-limit" id="bedrock-region-token-limit"></a>

For Amazon Bedrock, to configure the connection, set the following environment variables:

* `LLM_PROVIDER_AMAZON_BEDROCK_REGION` - The specific AWS Region to use for Amazon Bedrock calls. If you do not set this variable, then Textual uses the AWS Region set as the value of `AWS_DEFAULT_REGION`.
* `LLM_PROVIDER_AMAZON_BEDROCK_MAX_TOKENS` - The maximum number of output tokens for Amazon Bedrock responses. The default value is 64000.

### Providing AWS credentials <a href="#bedrock-aws-credentials" id="bedrock-aws-credentials"></a>

The Amazon Bedrock client uses the standard AWS SDK credential chain. To configure the credentials, use one of these methods:

* **Environment variables:**
  * `AWS_ACCESS_KEY_ID`
  * `AWS_SECRET_ACCESS_KEY`
* **Shared credentials file:** `~/.aws/credentials`
* **IAM role:** When running on AWS infrastructure (Amazon EC2, Amazon ECS, Amazon EKS)

The credentials must have permission to invoke the bedrock:InvokeModel action for the specified model.

Note that the backend reads from `~/.aws/credentials`. If a `[default]` profile is configured, it takes precedence over environment variables. For more information about the credential resolution order, go to [Credential and profile resolution - AWS SDK for .NET (V3)](https://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/creds-assign.html).

## GoogleAI Studio

To configure the connection to Google AI Studio, set the following environment variables:

* `LLM_PROVIDER_GOOGLE_AI_STUDIO_URL` - The endpoint URL for the LLM service.
* `LLM_PROVIDER_GOOGLE_AI_STUDIO_API_KEY` - The API key to use for the connection.

## OpenAI-compatible

### Recommended model

For an OpenAI-compatible API, we recommend Opus 4.5. For example, `claude-opus-4-5-20251101`.

### **Configuring the connection**

To configure the connection to an OpenAI-compatible model, set the following environment variables:

* `LLM_PROVIDER_OPEN_AI_URL` - The endpoint URL for the LLM service.
* `LLM_PROVIDER_OPEN_AI_API_KEY` - The API key to use for the connection.

## Gemini Enterprise Agent Platform

### Recommended model

We recommend Gemini 2.5 Flash.

### Configuring the connection

To configure the connection to Gemini Enterprise Agent Platform, set the following environment variables:

* `LLM_PROVIDER_VERTEX_AI_URL` - The endpoint URL for the LLM service The URL is `https://<region>-aiplatform.googleapis.com`. For example, `https://us-central1-aiplatform.googleapis.com`.
* `LLM_PROVIDER_VERTEX_AI_API_KEY` - The API key to use for the connection. For more information about obtaining an API key for Gemini Enterprise Agent Platform, go to [this information in the Google documentation](https://docs.cloud.google.com/vertex-ai/generative-ai/docs/start/api-keys?usertype=standard).

## Verifying the connections

Move from the model-based types topic.

After you configure the environment variables, restart the Textual Worker service.

The service is initialized the first time that it is used, for example when you create an entity type and add a test or training file.

You can then check the worker logs to verify that the connection is successful.

For successful connections, the logs include `<provider> client initialized`.

If configuration is missing or invalid, then:

* The feature that requires the connection is disabled.
* A warning is added to the logs.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.tonic.ai/textual/textual-install-administer/configuring-textual/enable-and-configure-textual-features/configuring-connections-to-llm-providers.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
