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

# Troubleshooting

> Resolve common LinkModel agent integration issues for OpenCode, Claude Code, and Codex.

## Which Endpoint Should I Use?

| Client behavior                           | Use                                            |
| ----------------------------------------- | ---------------------------------------------- |
| OpenAI Chat Completions-compatible client | `https://api.linkmodel.ai/v1/chat/completions` |
| Anthropic Messages-compatible client      | `https://api.linkmodel.ai/v1/messages`         |
| Codex or Responses API client             | `https://api.linkmodel.ai/v1/responses`        |

Use the base URL `https://api.linkmodel.ai/v1` when the agent appends endpoint paths automatically.

## Authentication Fails

Check that the agent can read your environment variable:

```bash theme={null}
echo "$LINKMODEL_API_KEY"
```

For Codex desktop apps or editor extensions, put the key in `~/.codex/.env` and restart the app:

```text theme={null}
LINKMODEL_API_KEY=<YOUR_API_KEY>
```

For Claude Code, use `ANTHROPIC_AUTH_TOKEN` with the LinkModel key:

```bash theme={null}
export ANTHROPIC_AUTH_TOKEN="$LINKMODEL_API_KEY"
```

## Model Not Found

Check the current model list:

```text theme={null}
https://docs.linkmodel.ai/models
```

Then use the exact model ID in the agent configuration.

## Tool Calling Fails

Coding agents often send tool/function-calling fields. If the model rejects the request:

* Use the endpoint matching the agent's native protocol.
* Try a coding-oriented model such as `gpt-5.3-codex`, `gpt-5.6-sol`, `claude-opus-4-7`, or `deepseek-v4-pro`.
* Test with a smaller prompt before running a large coding task.

## Codex Uses The Wrong Provider

Check `~/.codex/config.toml`:

```toml theme={null}
model_provider = "linkmodel"
```

Then open `/status` in Codex and confirm the active provider.

## Related

* [Models](/models)
* [OpenAI-compatible Chat Completions](/api-reference/chat/openai-chat-completions)
* [Anthropic-compatible Messages](/api-reference/chat/anthropic-messages)
* [OpenAI-compatible Responses](/api-reference/chat/openai-responses)
