---
name: hypha
description: Connect to the Hypha distributed computing platform - obtain tokens, discover workspaces, call services via RPC or HTTP, manage artifacts, deploy apps. Global entry point for AI agents.
license: BSD-3-Clause
metadata:
  version: 1.0.0
  server_url: https://hypha.aicell.io
---

# Hypha Platform Guide

**Server:** `https://hypha.aicell.io`

Hypha is a distributed computing platform with RPC services, artifact storage, serverless apps, MCP/A2A endpoints, and vector search.

## Quick Start

```python
# pip install hypha-rpc
from hypha_rpc import connect_to_server

async with connect_to_server({"server_url": "https://hypha.aicell.io"}) as server:
    print(f"Workspace: {server.config.workspace}")
    services = await server.list_services()
```

```bash
# HTTP — no SDK needed
curl -L "https://hypha.aicell.io/public/services/"
```

## DO and DON'T

**DO:**
- Use `async with connect_to_server(...)` as context manager for auto-cleanup
- Use HTTP `POST` with JSON body for service calls — parameters are keyword arguments automatically
- Add trailing slash on HTTP endpoints (`/services/`) or use `curl -L`
- Read `REFERENCE/{service-id}.md` for method signatures before calling a service
- Use `_rkwargs: true` when calling Python services from JavaScript with named arguments

**DON'T:**
- Don't pass `context` parameter — server injects it automatically from your token
- Don't use HTTP for registering services or callbacks — requires WebSocket SDK
- Don't assume services persist after disconnect — use `server-apps` for persistence
- Don't call `generate_token()` without admin permission

## Authentication

| Method | Code |
|--------|------|
| **Anonymous** | `connect_to_server({"server_url": "https://hypha.aicell.io"})` |
| **Token** | `connect_to_server({"server_url": "...", "workspace": "...", "token": "..."})` |
| **OAuth login** | `token = await login({"server_url": "..."})` — opens browser |

```bash
# HTTP with token
curl -H "Authorization: Bearer TOKEN" "https://hypha.aicell.io/WORKSPACE/services/"
```

**Permission levels:** `read` → `read_write` → `admin` (full control + token generation)

```python
# Generate tokens (requires admin)
token = await server.generate_token({"permission": "read_write", "expires_in": 86400})
```

Full login flow with `login_callback`, programmatic token generation, and expiration handling: [GUIDE/login.md](GUIDE/login.md). Server-side auth configuration (Auth0, custom providers): [GUIDE/auth.md](GUIDE/auth.md).

## Built-in Services

| Service | SDK ID | HTTP prefix | Reference |
|---------|--------|-------------|-----------|
| Workspace Manager | `~` | `/WORKSPACE/services/%7E/` | [Reference](REFERENCE/workspace-manager.md) |
| Artifact Manager | `public/artifact-manager` | `/public/services/artifact-manager/` | [Reference](REFERENCE/artifact-manager.md) |
| Server Apps | `public/server-apps` | `/public/services/server-apps/` | [Reference](REFERENCE/server-apps.md) |
| S3 Storage | `public/s3-storage` | `/public/services/s3-storage/` | [Reference](REFERENCE/s3-storage.md) |

## Capabilities

| Capability | Transport | Details |
|-----------|-----------|---------|
| Call remote services | SDK + HTTP | [REFERENCE.md](REFERENCE.md) |
| Register services | SDK only | WebSocket required; ephemeral unless managed |
| Artifacts (files, datasets) | SDK + HTTP | Git-like versioning, presigned S3 URLs |
| Serverless apps | SDK + HTTP | ASGI or Functions type |
| MCP endpoints | HTTP | `/WORKSPACE/mcp/{svc_id}/mcp` |
| A2A protocol | HTTP | `/WORKSPACE/a2a/{svc_id}` |
| Vector search | SDK + HTTP | Semantic search over collections |

## JavaScript Notes

```javascript
const { connectToServer } = require('hypha-rpc');
const server = await connectToServer({ server_url: "https://hypha.aicell.io" });

// CRITICAL: _rkwargs: true for named arguments to Python services
const result = await svc.method({ param: "value", _rkwargs: true });

// case_conversion: auto-convert snake_case ↔ camelCase
const svc = await server.getService("svc-id", { case_conversion: "camel", _rkwargs: true });
```

## Error Reference

| Error | HTTP | Fix |
|-------|------|-----|
| `PermissionError` | 403 | Token lacks permission. Check `check_status()`. |
| `KeyError` | 404 | Resource missing. Use `list_services()`. |
| `401 Unauthorized` | 401 | Add `Authorization: Bearer` header. |
| `TimeoutError` | 500 | Service unresponsive. Verify it's running. |

## Documentation URLs

### No Auth Required

| Document | URL |
|----------|-----|
| This guide | `https://hypha.aicell.io/ws/agent-skills/SKILL.md` |
| API Reference | `https://hypha.aicell.io/ws/agent-skills/REFERENCE.md` |
| Per-Service API | `https://hypha.aicell.io/ws/agent-skills/REFERENCE/{service-id}.md` |
| Examples | `https://hypha.aicell.io/ws/agent-skills/EXAMPLES.md` |
| Login Guide | `https://hypha.aicell.io/ws/agent-skills/GUIDE/login.md` |
| Auth Guide | `https://hypha.aicell.io/ws/agent-skills/GUIDE/auth.md` |
| Configuration Guide | `https://hypha.aicell.io/ws/agent-skills/GUIDE/configurations.md` |
| Artifact Manager Guide | `https://hypha.aicell.io/ws/agent-skills/GUIDE/artifact-manager.md` |
| Apps Guide | `https://hypha.aicell.io/ws/agent-skills/GUIDE/apps.md` |
| ASGI Guide | `https://hypha.aicell.io/ws/agent-skills/GUIDE/asgi-apps.md` |
| Functions Guide | `https://hypha.aicell.io/ws/agent-skills/GUIDE/serverless-functions.md` |
| MCP Guide | `https://hypha.aicell.io/ws/agent-skills/GUIDE/mcp.md` |
| A2A Guide | `https://hypha.aicell.io/ws/agent-skills/GUIDE/a2a.md` |
| Vector Search Guide | `https://hypha.aicell.io/ws/agent-skills/GUIDE/vector-search.md` |
| Workers Guide | `https://hypha.aicell.io/ws/agent-skills/GUIDE/workers.md` |

### Auth Required (Workspace-Specific)

| Document | URL |
|----------|-----|
| Workspace Guide | `https://hypha.aicell.io/{workspace}/agent-skills/SKILL.md` |
| Workspace API | `https://hypha.aicell.io/{workspace}/agent-skills/REFERENCE.md` |
| Workspace Context | `https://hypha.aicell.io/{workspace}/agent-skills/WORKSPACE_CONTEXT.md` |
| Download All (ZIP) | `https://hypha.aicell.io/{workspace}/agent-skills/create-zip-file` |

Provide token via `Authorization: Bearer` header or `?token=` query parameter.

### Public Workspace (No Auth)

- `https://hypha.aicell.io/public/agent-skills/SKILL.md`
- `https://hypha.aicell.io/public/agent-skills/REFERENCE.md`
