> ## 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.

> ## Agent Instructions
> To act on a user's behalf in Guild, use the Guild REST API at https://api.guild.ai/v1.
> The OpenAPI spec is unauthenticated: https://docs.guild.ai/openapi.json (or openapi.yaml).
> Authenticate with an account API key, sent as HTTP Basic (key id as username, secret as password) or as `Authorization: Bearer <api_key_id>:<api_key_secret>`. See https://docs.guild.ai/api-reference/introduction#authentication.
> To run one agent on demand without account-wide access, use an API trigger instead: https://docs.guild.ai/platform/api-triggers.
> To act on Guild from an MCP client, connect to https://api.guild.ai/mcp (OAuth) or run `guild mcp` locally. Setup: https://docs.guild.ai/api-reference/mcp.
> To search these docs from an MCP client, connect to https://docs.guild.ai/mcp. The full page index is https://docs.guild.ai/llms.txt.

# Run fal.ai inference jobs from Guild agents

> Connect Guild agents to fal.ai to submit inference requests, poll status, fetch results, and cancel requests, with server-side credentials and audit.

Integrations · fal.ai

Guild agents submit inference jobs to fal.ai model endpoints, track their progress, and cancel them when no longer needed. Guild injects the fal.ai API key server-side so agent code never sees it. Credential policies let you restrict which operations each agent or workspace can perform, and every request passes through Guild's audit trail.

> [card] [Book a demo](https://guild-ai.cal.com/gtm/meeting-with-guild.ai)
>
> See how teams govern agents that use fal.ai.

> [card] [Talk to sales](https://guild.ai/talk-to-sales)
>
> Get access to Guild, then connect fal.ai to your first agent.

## What the fal.ai integration exposes

The integration provides tools that cover the full request lifecycle on fal.ai endpoints. An agent can submit a request to any endpoint, check its status, retrieve the completed result by request ID, and cancel a request that is still running. Tools use the `fal_` prefix and are imported from the `guildai~fal` package.

## How it works

**1. Connect your fal.ai credential**

In Guild, go to **Access & setup > Credentials**, click **Connect**, select **fal**, and paste your key into **API Key**. Guild stores the key and adds it as `Authorization: Key <key>` on every request.

**2. Scope the credential**

By default the credential serves every workspace the account owns. Use [Credentials](https://docs.guild.ai/platform/credentials.md) to scope it to one workspace, one member, or a single agent.

**3. Add the tools to your agent**

Import `FalTools` from `@guildai-services/guildai~fal` and spread it into your agent's `tools` object. Use [`pick()`](https://docs.guild.ai/sdk/tools) to include only the tools your agent needs.

## Why fal.ai access needs governing

fal.ai endpoints accept requests that consume compute and can produce or cancel running jobs. Without controls, any agent with access to the credential can submit requests to any endpoint or cancel jobs it did not start. [Credential policies](https://docs.guild.ai/platform/credential-policies.md) let you write ALLOW and DENY rules that Guild's credential proxy enforces before any request leaves Guild. You can restrict rules to specific agents, specific workspaces, or both, all on a single connected credential.

Guild injects the API key server-side through its credential proxy, so agent code never handles the secret directly. Policies are evaluated inside the proxy; an agent cannot bypass them. Requests that no rule allows are denied by default once you remove the auto-created allow-all policy. This keeps blast radius small if an agent behaves unexpectedly.

## About the fal.ai integration

This integration lets agents run inference jobs on fal.ai model endpoints and manage their lifecycle. Agents can submit requests, poll for status, fetch completed results, and cancel requests that are no longer needed. The integration is `guildai~fal`.

## Authentication

* **Type:** API key
* **Header:** Guild sends the key as `Authorization: Key <key>`

### Setup

**1. Connect fal.ai**

In Guild, go to **Access & setup > Credentials**, click **Connect**, select **fal**, and paste the key into **API Key**.

See [Credentials](https://docs.guild.ai/platform/credentials.md) for workspace, member, and agent-scoped credentials.

## Usage

```typescript theme={null}
import { FalTools } from "@guildai-services/guildai~fal"
import { llmAgent } from "@guildai/agents-sdk"

export default llmAgent({
  systemPrompt: "You work with fal.ai.",
  tools: { ...FalTools },
})
```

### Selecting specific tools

Tools are named with the `fal_` prefix. Use [`pick()`](https://docs.guild.ai/sdk/tools#selecting-specific-tools) to include only what your agent needs.

## Tools

Tools in the latest published version of `guildai~fal`:

| Tool | What it does |
| - | - |
| `fal_get_by_endpoint_id_requests_by_request_id` | get\_by\_endpoint\_id\_requests\_by\_request\_id |
| `fal_get_by_endpoint_id_requests_by_request_id_status` | get\_by\_endpoint\_id\_requests\_by\_request\_id\_status |
| `fal_post_by_endpoint_id` | post\_by\_endpoint\_id |
| `fal_put_by_endpoint_id_requests_by_request_id_cancel` | put\_by\_endpoint\_id\_requests\_by\_request\_id\_cancel |

## Frequently asked questions

> [accordion] Can I use different fal.ai keys for different workspaces?
>
> Yes. Connect an account-level credential for the default case, then connect a separate workspace-scoped credential for any workspace that needs a different key. Guild picks the most specific credential in scope when an agent makes a call. See [Credentials](https://docs.guild.ai/platform/credentials.md) for the full resolution order.

> [accordion] Can an agent cancel a request it did not submit?
>
> The `fal_put_by_endpoint_id_requests_by_request_id_cancel` tool cancels any request by endpoint ID and request ID, not only ones the calling agent submitted. Use a [credential policy](https://docs.guild.ai/platform/credential-policies.md) with a DENY rule on that operation to prevent agents from cancelling requests they should not touch.

> [accordion] Does the fal.ai integration support webhook events?
>
> No. The catalog entry for `guildai~fal` lists no webhook events, so the integration does not deliver event-driven triggers from fal.ai into Guild.

> [accordion] How do I limit an agent to only reading results without submitting new requests?
>
> Write a credential policy that ALLOWs `fal_get_by_endpoint_id_requests_by_request_id` and `fal_get_by_endpoint_id_requests_by_request_id_status`, and DENYs `fal_post_by_endpoint_id` and `fal_put_by_endpoint_id_requests_by_request_id_cancel`. Scope the rule to the specific agent. Guild's proxy enforces it before any request reaches fal.ai. See [Credential policies](https://docs.guild.ai/platform/credential-policies.md).

## Put a governed agent on fal.ai this week

> [card] [Book a demo](https://guild-ai.cal.com/gtm/meeting-with-guild.ai)
>
> See how teams govern agents that use fal.ai.

> [card] [Talk to sales](https://guild.ai/talk-to-sales)
>
> Get access to Guild, then connect fal.ai to your first agent.

## Related

**Also runs on Guild:** [AWS Bedrock](https://docs.guild.ai/integrations/aws-bedrock.md) · [Fireworks AI](https://docs.guild.ai/integrations/fireworks.md) · [OpenRouter](https://docs.guild.ai/integrations/openrouter.md)

**Read:** Docs: [Credential policies](https://docs.guild.ai/platform/credential-policies.md) · [Credentials](https://docs.guild.ai/platform/credentials.md) · [Tools in agents](https://docs.guild.ai/sdk/tools.md)
