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

# Connect coding tools

> Connect Codex, Claude Code, OpenCode, Pi, Grok Build, or Aider to Floodgate, and add tools for image, speech, and video generation.

Use your Floodgate API key with a coding tool, SDK, or workflow builder. Choose the API format your client uses, then add media tools if you want it to generate images, speech, or video.

## Choose a coding tool

| Client | Setup guide | API and base URL |
| - | - | - |
| ![Codex logo](https://mintcdn.com/floodgate/6KF2CNow7MI_O0vh/images/logos/codex.png?fit=max\&auto=format\&n=6KF2CNow7MI_O0vh\&q=85\&s=3dbe9df0e518e61f1f8f13252764c2fd) Codex | [Codex](https://docs.floodgate.dev/agents/codex.md) | Responses, `https://api.floodgate.dev/v1` |
| ![Claude Code logo](https://mintcdn.com/floodgate/6KF2CNow7MI_O0vh/images/logos/claude-code.png?fit=max\&auto=format\&n=6KF2CNow7MI_O0vh\&q=85\&s=c01439686aa74c108651a2e606c98521) Claude Code | [Claude Code](https://docs.floodgate.dev/agents/claude-code.md) | Messages, `https://api.floodgate.dev` |
| ![OpenCode logo](https://mintcdn.com/floodgate/6KF2CNow7MI_O0vh/images/logos/opencode.png?fit=max\&auto=format\&n=6KF2CNow7MI_O0vh\&q=85\&s=84681698b361c6726adbe5720649dbab) OpenCode | [OpenCode](https://docs.floodgate.dev/agents/opencode.md) | Chat Completions with the configuration in the guide |
| ![Pi logo](https://mintcdn.com/floodgate/6KF2CNow7MI_O0vh/images/logos/pi.png?fit=max\&auto=format\&n=6KF2CNow7MI_O0vh\&q=85\&s=1717ea7010d4d3be9dcc95f66bfd937c) Pi | [Pi](https://docs.floodgate.dev/agents/pi.md) | Chat Completions with the `openai-completions` setting |
| ![Grok Build logo](https://mintcdn.com/floodgate/6KF2CNow7MI_O0vh/images/logos/grok-build.png?fit=max\&auto=format\&n=6KF2CNow7MI_O0vh\&q=85\&s=6e3aecd3936e6c72dd7d1fb013a1149c) Grok Build | [Grok Build](https://docs.floodgate.dev/agents/grok-build.md) | OpenAI-compatible API |
| ![Aider logo](https://mintcdn.com/floodgate/6KF2CNow7MI_O0vh/images/logos/aider.png?fit=max\&auto=format\&n=6KF2CNow7MI_O0vh\&q=85\&s=47633a00da37b69696b88824113ec897) Aider | [Aider](https://docs.floodgate.dev/agents/aider.md) | OpenAI-compatible API with the `openai/` model prefix |

Add funds to your [balance](https://docs.floodgate.dev/billing.md) and [configure your API key](https://docs.floodgate.dev/routing-groups.md) before connecting. Set routing groups or a smart routing preference, then choose a spending limit.

Find models and their supported APIs in [Model Square](https://floodgate.dev/models). Your key's routing settings apply when you switch models.

## Generate images and speech

Add a script, function, or MCP tool that calls the [image](https://docs.floodgate.dev/images.md) or [speech](https://docs.floodgate.dev/audio.md) API. The tool takes a prompt or text, sends the request with your API key, and saves the returned file.

For base64 responses, decode the data before saving. For binary audio, write the response bytes to a file. For an image URL, download the file. Return the local path to your coding client so it can use the result.

Keep your API key in the tool's environment. Do not include it in prompts or tool arguments.

## Generate video

A video tool needs to:

1. Submit a request using the model's API.
2. Keep the returned task ID and check its status.
3. Download the completed video with authentication.

The [video guide](https://docs.floodgate.dev/videos.md) includes Veo and Wan request examples. Keep task IDs so your tool can resume checking an existing job after a timeout.

## Use an SDK or workflow builder

OpenAI-compatible SDKs can call Chat Completions, Responses, Images, and Speech. Use HTTP requests for native Gemini and Wan APIs.

In a workflow builder, configure an HTTP action with the documented URL, method, Authorization header, and JSON body. Handle the response as JSON, base64 data, binary audio, or a background task, depending on the API.

See [Function tools and MCP](https://docs.floodgate.dev/tools.md) for how to connect tools to your application or coding client.


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