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

# Python API

> Every name exported by the cycls package, with its purpose and the page that documents it.

Reference for `import cycls`. Names are listed by area.

## Decorators

| Name                     | Signature                                                                                                                             | Documented in                                      |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
| `cycls.function`         | `(name=None, image=None, *, cpu=None, memory=None, timeout=None, concurrency=None, volumes=None, schedule=None, python_version=None)` | [Functions](/build/functions)                      |
| `cycls.app`              | `(name=None, image=None, *, volumes=None, auth=None, memory="1Gi")`                                                                   | [Apps](/build/apps)                                |
| `cycls.agent`            | `(name=None, image=None, *, web=None, volumes=None, memory="1Gi")`                                                                    | [Agents](/agents/overview)                         |
| `cycls.local_entrypoint` | `(fn)`                                                                                                                                | [Functions](/build/functions#the-development-loop) |

## Builders

| Name            | Purpose                              | Documented in                                        |
| --------------- | ------------------------------------ | ---------------------------------------------------- |
| `cycls.Image`   | container build configuration        | [Images](/build/images)                              |
| `cycls.Volume`  | named persistent storage             | [Volumes](/build/volumes)                            |
| `cycls.Cron`    | schedule for a deployed function     | [Cron](/build/cron)                                  |
| `cycls.Web`     | interface, auth, branding, analytics | [Interface](/web/interface)                          |
| `cycls.LLM`     | model, prompt, tools, budgets        | [Models](/agents/models)                             |
| `cycls.MCP`     | a remote MCP server                  | [Connectors and MCP](/agents/connectors#mcp-servers) |
| `cycls.Sandbox` | bubblewrap command execution         | [Apps](/build/apps#running-untrusted-commands)       |

## Authentication

| Name             | Purpose                             | Documented in                                                  |
| ---------------- | ----------------------------------- | -------------------------------------------------------------- |
| `cycls.Clerk`    | Clerk provider, hosted defaults     | [Authentication](/web/auth#clerk)                              |
| `cycls.JWT`      | any OIDC provider with a JWKS URL   | [Authentication](/web/auth#any-oidc-provider)                  |
| `cycls.GCP`      | Firebase and GCP Identity Platform  | [Authentication](/web/auth#firebase-and-gcp-identity-platform) |
| `cycls.AppleIAP` | StoreKit 2 entitlement verification | [Plans and quotas](/web/monetization#apple-in-app-purchase)    |
| `cycls.User`     | the authenticated user model        | [Authentication](/web/auth#the-user-object)                    |

## Connectors

| Name             | Purpose                                     | Documented in                                         |
| ---------------- | ------------------------------------------- | ----------------------------------------------------- |
| `cycls.OAuth2`   | authorization code grant with PKCE          | [Connectors](/agents/connectors#three-kinds-of-grant) |
| `cycls.Key`      | a key the user pastes                       | [Connectors](/agents/connectors#three-kinds-of-grant) |
| `cycls.Endpoint` | a private URL that is itself the credential | [Connectors](/agents/connectors#three-kinds-of-grant) |
| `cycls.env`      | a deployment secret resolved at use time    | [Connectors](/agents/connectors)                      |

## Storage

| Name              | Purpose                                   | Documented in                                          |
| ----------------- | ----------------------------------------- | ------------------------------------------------------ |
| `cycls.DB`        | per-user JSON key-value store on a volume | [Volumes](/build/volumes#structured-state-on-a-volume) |
| `cycls.Workspace` | a resolved storage scope                  | [Context](/agents/context#the-workspace)               |

## Analytics and notifications

| Name              | Purpose                     | Documented in                                              |
| ----------------- | --------------------------- | ---------------------------------------------------------- |
| `cycls.PostHog`   | PostHog analytics provider  | [Interface](/web/interface#analytics-and-push)             |
| `cycls.GTM`       | Google Tag Manager provider | [Interface](/web/interface#analytics-and-push)             |
| `cycls.OneSignal` | web push provider           | [Interface](/web/interface#analytics-and-push)             |
| `cycls.log`       | one structured log record   | [Observability](/ship/observability#emit-your-own-records) |

## Remote execution

| Name                 | Purpose                                         | Documented in                           |
| -------------------- | ----------------------------------------------- | --------------------------------------- |
| `cycls.remote(name)` | callable for a deployed endpoint, with `.map()` | [Functions](/build/functions#deploying) |
| `cycls.RemoteError`  | raised when a remote call fails                 | [Functions](/build/functions)           |

## Events

| Name           | Purpose                               | Documented in                                |
| -------------- | ------------------------------------- | -------------------------------------------- |
| `cycls.events` | dict factories for loop events        | [Custom loops](/agents/custom-loop#the-kit)  |
| `cycls.to_ui`  | identity function kept for older code | [Agents](/agents/overview#watching-the-loop) |

## Module configuration

```python theme={null}
import cycls

cycls.api_key = "..."      # same as CYCLS_API_KEY
cycls.base_url = "..."     # same as CYCLS_BASE_URL
```

## Object methods

### Function, App and Agent

| Method                          | Available on | Meaning                                       |
| ------------------------------- | ------------ | --------------------------------------------- |
| `.run(*args, **kwargs)`         | Function     | execute in local Docker                       |
| `.remote(*args, **kwargs)`      | Function     | execute current code in the cloud             |
| `.map(items, workers=16)`       | Function     | fan out, ordered results                      |
| `.build()`                      | Function     | build the image only                          |
| `.watch(*args, **kwargs)`       | Function     | run with file watching                        |
| `.local(port=8080, watch=True)` | App, Agent   | serve in Docker                               |
| `.deploy()`                     | all          | publish                                       |
| `.server`                       | App, Agent   | route registrations replayed in the container |
| `.auth`                         | App, Agent   | FastAPI dependency returning the `User`       |
| `.workspace`                    | App, Agent   | FastAPI dependency returning the `Workspace`  |
| `.prod`                         | App, Agent   | `True` when deployed                          |

## Next

<Card title="Agent HTTP API" icon="server" href="/reference/agent-api">
  Every endpoint a deployed agent serves.
</Card>
