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

# OpenAI

> Use GPT and o-series models from OpenAI in your Guild agents: supported models, inference providers, setup, and agent code.

Guild supports GPT and o-series models from OpenAI. This page lists the models Guild recognizes, the inference providers that serve them, and how to call them from an agent.

| | |
| - | - |
| Name under **Models** in the credential form | OpenAI |
| `provider` in `llmPreferences` | `"openai"` |
| Default model | `gpt-4o` |
| Managed access | Yes, when Guild holds a managed key |

## Inference providers

You can reach these models through the OpenAI API itself or through a third-party provider.

| Provider | Notes |
| - | - |
| OpenAI | The publisher's own API. Available on every account. |
| [AWS Bedrock](/platform/providers/aws-bedrock) | Serves GPT-5.4 and later, including the `gpt-6` models, plus the open-weight `gpt-oss` models. |
| [OpenRouter](/platform/providers/openrouter) | Served under OpenRouter's `openai/` namespace. |
| [Fireworks AI](/platform/providers/fireworks) | Serves `gpt-oss-120b`. |

Write the canonical model name, such as `gpt-4o`, everywhere in Guild. Guild maps it to each provider's own model ID.

## Models

Guild prices and recognizes these OpenAI model IDs. A policy or preference can also name any other model your credential can reach. Third-party providers route more models than this list, and their catalogs change; see each provider's page for what it serves.

| Model | Notes |
| - | - |
| `gpt-5.6-sol` | |
| `gpt-5.6-terra` | |
| `gpt-5.6-luna` | |
| `gpt-5.5` | |
| `gpt-5.4` | |
| `gpt-5.4-mini` | |
| `gpt-5` | |
| `gpt-5-mini` | |
| `gpt-5-nano` | |
| `gpt-5-pro` | |
| `gpt-4.1` | |
| `gpt-4.1-mini` | |
| `gpt-4.1-nano` | |
| `gpt-4o` | The default. |
| `gpt-4o-mini` | |
| `o3` | |
| `o3-mini` | |
| `o3-pro` | |
| `o4-mini` | |
| `gpt-oss-120b` | Open-weight. Served by Fireworks AI and Bedrock, not the OpenAI API. |

## Set up OpenAI

On a managed account, agents can use OpenAI models without a credential, as long as Guild holds a managed key for OpenAI. To use your own OpenAI account instead, add a credential. Adding your first credential switches the whole account to bring your own key (BYOK).

<Steps>
  <Step title="Open Models & providers">Click **Access & setup** in the left nav, then **Models & providers**. In an organization, only admins can open it.</Step>
  <Step title="Add a credential">Click **Add API key** and choose an inference provider from the table above.</Step>
  <Step title="Enter the provider's secret">Give the credential a **Name** and paste your provider's **API key**. [AWS Bedrock](/platform/providers/aws-bedrock) asks for an IAM role and region instead.</Step>
  <Step title="Choose OpenAI">Under **Models**, check **OpenAI**. Keep `gpt-4o` as its default model or enter another from the list above. Then click **Add Key**. On [Fireworks AI](/platform/providers/fireworks), pick a model from its list, because the pre-filled default isn't available there.</Step>
</Steps>

To control which workspaces and agents can use OpenAI models, add a [model policy](/platform/llm-settings#model-policies) for the credential. For example, `--models "gpt-5*"` limits a policy to matching models:

```bash theme={null}
guild llm policy create --credential <credential-id> --publisher OPENAI --target-id <workspace-or-agent-id> --models "gpt-5*"
```

## Use it from an agent

Agent code never names a credential. Guild resolves the call against the workspace owner's settings. To ask for OpenAI explicitly, put it in `llmPreferences`:

```typescript theme={null}
const result = await task.llm.generateText({
  prompt: "Summarize this text...",
  llmPreferences: [
    { provider: "openai", model: "gpt-5" },
    { provider: "openai" },
  ],
})
```

The first entry asks for `gpt-5`. The second falls back to the default model of the matching policy. Preferences are strict: if no credential or policy allows any of them, the call fails rather than using another publisher. See [LLM preferences](/guide/llms#llm-preferences).

## Notes

* OpenAI streaming responses always include token usage, so Guild can attribute spend to the session.
* Guild removes reasoning parameters a model doesn't accept, so the same request works across GPT and o-series models.
* The [Codex](/guide/codex-driver) runtime driver calls the OpenAI Responses API through the runtime, so it needs an OpenAI credential or managed OpenAI access.

## Related pages

* [Models & providers](/platform/llm-settings) for credentials, model policies, and the daily token limit
* [LLMs](/guide/llms) for `task.llm` and the unified LLM proxy
* [Usage](/insights/usage) for spend by model
