# Ultra API

Base URL: https://ultra.egomonk.com

## Endpoints

### Upload a file
```
POST /api/upload
Content-Type: multipart/form-data
Body: file=@yourfile.pdf
```
Returns: { id, shareUrl, downloadUrl, expiresAt }

### Download a file
```
GET /api/dl/{id}
```
Returns: file stream (forced download)

### Create a live pipe (instant link before upload)
```
POST /api/pipe
Body: { filename, mimeType, size, ttl }
```
Returns: { pipeId, shareUrl, expiresAt }

### Push chunk to pipe
```
POST /api/pipe/{id}/push
Body: binary chunk
```

### Signal pipe complete
```
POST /api/pipe/{id}/done
```

### Stream from pipe (receiver)
```
GET /api/pipe/{id}/stream
```

### Pipe status
```
GET /api/pipe/{id}/status
```
Returns: { senderSent, receiverSent, size, done, filename }

### Resolve a share link
```
GET /api/share/{shareId}
```
Returns: { type, shareId, pipeId? , folderId? }

### Open share page
```
GET /s/{shareId}
```

## CLI Examples
```bash
# Upload
curl -F "file=@photo.jpg" https://ultra.egomonk.com/api/upload

# Download  
curl -OJL https://ultra.egomonk.com/api/dl/{id}
```

## MCP Server
Install: pip install "mcp[cli]"
Add: claude mcp add ultra python3 /path/to/server.py
Tools: upload_file, upload_text, download_file, download_share
