# API reference

> The base URL, authentication and every endpoint of the Fous API, version 1.0.0, by resource.

Source: https://docs.fous.com/api-reference
Index: https://docs.fous.com/llms.txt

The Fous API is served at `https://api.fous.com`. Its contract is [OpenAPI 3.1](https://api.fous.com/openapi.json), version 1.0.0, and this reference is generated from it.

## Authentication

Send your organization’s key as `Authorization: Bearer $FOUS_API_KEY`. Every endpoint needs it. Without a valid key, an endpoint answers `401` with `unauthorized`. [Create a key](https://docs.fous.com/authentication.md).

## Endpoints

### Methods

Find methods, read their contracts, publish or delete your own. [Methods](https://docs.fous.com/api-reference/methods.md)

- `GET /v1/search`: Find methods
- `GET /v1/methods`: List your methods
- `GET /v1/methods/{domain}/{name}`: Get a method
- `PATCH /v1/methods/{domain}/{name}`: Update a method
- `DELETE /v1/methods/{domain}/{name}`: Delete a method

### Runs

Run a method with your own input, or send a query and get the result. [Runs](https://docs.fous.com/api-reference/runs.md)

- `POST /v1/runs`: Run a method or a query
- `GET /v1/runs/{id}`: Get a run
- `POST /v1/runs/{id}/cancel`: Cancel a run

### Builds

Build a method, steer it with messages, and follow it to the end. [Builds](https://docs.fous.com/api-reference/builds.md)

- `GET /v1/builds`: List builds
- `POST /v1/builds`: Build a method
- `GET /v1/builds/{id}`: Get a build
- `DELETE /v1/builds/{id}`: Dismiss a build
- `POST /v1/builds/{id}/cancel`: Cancel a build
- `POST /v1/builds/{id}/messages`: Message a build
- `GET /v1/builds/{id}/images/{position}`: Get a build image

### Connections

Website logins and API keys that methods run with. [Connections](https://docs.fous.com/api-reference/connections.md)

- `GET /v1/connections`: List connections
- `POST /v1/connections`: Connect an account
- `GET /v1/connections/{id}`: Check a connection
- `PATCH /v1/connections/{id}`: Update a connection
- `DELETE /v1/connections/{id}`: Delete a connection
- `POST /v1/connections/{id}/sign-in`: Run a sign-in
- `DELETE /v1/connections/{id}/sign-in`: Cancel the sign-in

### Account

The organization behind the key. [Account](https://docs.fous.com/api-reference/account.md)

- `GET /v1/account`: Get the account

## Errors

Every failure answers an HTTP error status with an `error` object: branch on `error.code`. [Errors](https://docs.fous.com/api-reference/errors.md) shows the object and the codes of each status; the [errors guide](https://docs.fous.com/guides/errors.md) says what to do about each code.
