> ## 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](https://docs.cycls.com/build/functions.md) |
| `cycls.app` | `(name=None, image=None, *, volumes=None, auth=None, memory="1Gi")` | [Apps](https://docs.cycls.com/build/apps.md) |
| `cycls.agent` | `(name=None, image=None, *, web=None, volumes=None, memory="1Gi")` | [Agents](https://docs.cycls.com/agents/overview.md) |
| `cycls.local_entrypoint` | `(fn)` | [Functions](https://docs.cycls.com/build/functions.md#the-development-loop) |

## Builders

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

## Authentication

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

## Connectors

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

## Storage

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

## Analytics and notifications

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

## Remote execution

| Name | Purpose | Documented in |
| - | - | - |
| `cycls.remote(name, *, url=None, api_key=None, timeout=3600)` | a callable for a deployed function. `.map(items, workers=16)` calls it once per item, results in order | [Functions](https://docs.cycls.com/build/functions.md#deploying) |
| `cycls.RemoteError` | raised when a remote call fails. `.status` is the HTTP status, or `None` | [Functions](https://docs.cycls.com/build/functions.md) |

## Events

| Name | Purpose | Documented in |
| - | - | - |
| `cycls.events` | dict factories for loop events | [Custom loops](https://docs.cycls.com/agents/custom-loop.md#the-kit) |
| `cycls.to_ui` | identity function kept for older code | [Agents](https://docs.cycls.com/agents/overview.md#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` | 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] [Agent HTTP API](https://docs.cycls.com/reference/agent-api.md)
>
> Every endpoint a deployed agent serves.


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