> For the complete documentation index, see [llms.txt](/llms.txt).
> A full single-fetch corpus is available at [llms-full.txt](/llms-full.txt).
---
title: AI providers
description: Connect model API keys in Studio, then call provider-prefixed models from agents, prompts, and low-level generation code.
last_verified: 2026-07-24
---



An **AI provider** integration stores the API key AGNT5 uses when your agents and prompts call a model API. You name models with a `"provider/model"` string, for example `"openai/gpt-4o-mini"` or `"anthropic/claude-3-5-sonnet-20241022"`. In managed deployments, configure provider keys in Studio so workers can resolve credentials without putting secrets in source code.

## Supported providers

Studio exposes these AI provider integrations for project and workspace configuration:

| Provider | Model prefix | API key env var |
|---|---|---|
| OpenAI | `openai` | `OPENAI_API_KEY` |
| Anthropic | `anthropic` | `ANTHROPIC_API_KEY` |
| Google AI | `google` or `gemini` | `GOOGLE_API_KEY` or `GEMINI_API_KEY` |
| Groq | `groq` | `GROQ_API_KEY` |
| OpenRouter | `openrouter` | `OPENROUTER_API_KEY` |
| Mistral AI | `mistral` | `MISTRAL_API_KEY` |
| DeepSeek | `deepseek` | `DEEPSEEK_API_KEY` |
| xAI | `xai` | `XAI_API_KEY` |

The Python and TypeScript SDKs also understand additional provider prefixes for local or advanced use, including `azure`, `bedrock`, `ollama`, `huggingface`, and `hf`. Those providers are not all exposed as first-class Studio integrations yet, so use ordinary environment configuration when you use them outside the Studio integration catalog.



**Go:**

The Go SDK has no `"provider/model"` string dispatch or `LM.provider()` namespace — each provider is its own constructor returning a `LanguageModel`: `agnt5.NewOpenAIModel`, `NewAnthropicModel`, `NewGoogleModel` (alias `NewGeminiModel`), `NewAzureOpenAIModel`, and the OpenAI-compatible `NewOpenRouterModel`, `NewGroqModel`, `NewDeepSeekModel`, `NewMistralModel`, `NewTogetherModel`, `NewXAIModel`, `NewMoonshotModel`, `NewOllamaModel` (all of the OpenAI-compatible ones take `agnt5.OpenAIConfig{Model: "..."}`). There's no built-in Bedrock or Hugging Face constructor yet.



## Configure credentials

For local development, set the provider API key before your worker starts:

```bash
export OPENAI_API_KEY=sk-...
export ANTHROPIC_API_KEY=sk-ant-...
export GOOGLE_API_KEY=...
export GROQ_API_KEY=...
export OPENROUTER_API_KEY=...
export MISTRAL_API_KEY=...
export DEEPSEEK_API_KEY=...
export XAI_API_KEY=...
```

For deployed workers, store provider keys in Studio:

1. Open your project in Studio.
2. Open **Settings** -> **Integrations**.
3. Add the provider integration and paste the API key.
4. Choose the narrowest scope that works: workspace, project, or environment-specific secret.

<DocsImage
  src="/docs/integrations/integrations-light.png"
  darkSrc="/docs/integrations/integrations-dark.png"
  alt="Screenshot of the AGNT5 Studio Settings → Integrations page showing configured AI provider integrations."
  caption="Studio Settings → Integrations — add a provider key and choose its scope."
  width={1682}
  height={1060}
/>

Your code should not pass raw provider keys. AGNT5 injects the credential into the worker environment or resolves it through the managed credential path at runtime.

## Use a provider in an agent

Create an agent with a provider-prefixed model string. To change providers, change the model string and make sure the matching credential is configured.



**Python:**

```python
from agnt5 import Agent

agent = Agent(
    name="summarizer",
    model="openai/gpt-4o-mini",
    instructions="Summarize articles into three concise bullet points.",
)

result = await agent.run("Summarize the product launch notes.")
print(result.output)
```

The same pattern works with another provider:

```python
from agnt5 import Agent

agent = Agent(
    name="summarizer",
    model="anthropic/claude-3-5-sonnet-20241022",
    instructions="Summarize articles into three concise bullet points.",
)
```





**TypeScript:**

```typescript
const agent = new Agent({
  name: 'summarizer',
  model: LM.openai(),
  modelName: 'openai/gpt-4o-mini',
  instructions: 'Summarize articles into three concise bullet points.',
});

const result = await agent.run('Summarize the product launch notes.');
console.log(result.output);
```

The same pattern works with another provider — swap the `LM` client and `modelName`:

```typescript
const agent = new Agent({
  name: 'summarizer',
  model: LM.anthropic(),
  modelName: 'anthropic/claude-3-5-sonnet-20241022',
  instructions: 'Summarize articles into three concise bullet points.',
});
```





**Go:**

```go
const lm = LM.openai();

const response = await lm.generate({
  model: 'openai/gpt-4o-mini',
  messages: [
    { role: 'user', content: 'Write a one-paragraph incident summary for a resolved API outage.' },
  ],
});

console.log(response.text);
```





**Go:**

Call `Generate` directly on a model, or `ctx.Generate(model, request)` from inside a function/workflow/tool handler:

```go
model := agnt5.NewOpenAIModel(agnt5.OpenAIConfig{
    APIKey: os.Getenv("OPENAI_API_KEY"),
    Model:  "gpt-4o-mini",
})

response, err := model.Generate(ctx, agnt5.GenerateRequest{
    Messages: []agnt5.Message{
        {Role: agnt5.MessageRoleUser, Content: "Write a one-paragraph incident summary for a resolved API outage."},
    },
})

fmt.Println(response.Content)
```



The `model` value still uses the same `"provider/model"` format, and the provider key still comes from the environment or the configured integration. The `model` value still uses the same `"provider/model"` format, and the provider key still comes from the environment or the configured integration. The Go SDK has no equivalent environment/integration auto-resolution — always set `APIKey` explicitly on the provider config, as shown above. 

## Provider-hosted tools

Provider-hosted tools run on the model provider's infrastructure. AGNT5 sends the tool request to the provider and records the result in the model response; your worker does not execute local tool code for these calls.



**Python:**

```python
from agnt5 import Agent
from agnt5.lm import BuiltInTool

agent = Agent(
    name="researcher",
    model="openai/gpt-4o-mini",
    instructions="Use web search for current facts before answering.",
    built_in_tools=[BuiltInTool.WEB_SEARCH],
)

result = await agent.run("What changed in the latest product release?")
print(result.output)
```

| Tool | What it does | Providers |
|---|---|---|
| `BuiltInTool.WEB_SEARCH` | Live web search with provider-returned results | OpenAI, Anthropic, Google |
| `BuiltInTool.CODE_INTERPRETER` | Run code in a provider-hosted sandbox | OpenAI |
| `BuiltInTool.FILE_SEARCH` | Search files hosted by the provider | OpenAI |
| `BuiltInTool.WEB_FETCH` | Fetch the content of a specific URL | Anthropic |





**TypeScript:**

```typescript
const agent = new Agent({
  name: 'researcher',
  model: LM.openai(),
  modelName: 'openai/gpt-4o-mini',
  instructions: 'Use web search for current facts before answering.',
  builtInTools: ['web_search'],
});

const result = await agent.run('What changed in the latest product release?');
console.log(result.output);
```

| Tool | What it does | Providers |
|---|---|---|
| `'web_search'` | Live web search with provider-returned results | OpenAI, Anthropic, Google |
| `'code_interpreter'` | Run code in a provider-hosted sandbox | OpenAI |
| `'file_search'` | Search files hosted by the provider | OpenAI |
| `'web_fetch'` | Fetch the content of a specific URL | Anthropic |





**Go:**

Not yet available in the Go SDK — there's no `built_in_tools`/`builtInTools` equivalent, so provider-hosted web search, code interpreter, file search, or URL fetch tools aren't exposed. Write a custom tool (see [Tools](/docs/build/tools.md)) that calls the provider's API directly if you need this capability today.



You can mix provider-hosted tools with AGNT5 custom tools on the same agent. See [Tools](/docs/build/tools.md) for custom tools, sandbox workspaces, and human-in-the-loop tools.

## Next steps

- [Agents](/docs/build/agents.md): configure model-backed reasoning loops.
- [Prompts](/docs/build/prompts.md): run managed prompts with provider-backed models.
- [Tools](/docs/build/tools.md): add custom, sandbox, and provider-hosted capabilities.
- [Deploying](/docs/run/deploying.md): deploy workers with integrations and secrets configured.
