You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All file paths are relative to `/workspaces`. Path traversal outside root is blocked.
502
502
503
+
#### OpenAI-compatible endpoints
504
+
505
+
The API also exposes an OpenAI-compatible adapter so tools like [LiteLLM](https://github.com/BerriAI/litellm), OpenAI SDKs, or anything that speaks `chat/completions` can connect directly.
506
+
507
+
**`GET /openai/v1/models`** — list available models:
Use the same model aliases as the CLI (`haiku`, `sonnet`, `opus`). `system` role messages become `--system-prompt`. Multiple user/assistant turns are concatenated into a single prompt. Pass `reasoning_effort` (`low`/`medium`/`high`) to control effort — maps to claude's `--effort`. `temperature` and `max_tokens` are accepted but ignored.
529
+
530
+
Custom headers for claude-specific behavior:
531
+
532
+
| Header | Description |
533
+
| ------ | ----------- |
534
+
| `X-Claude-Workspace` | Workspace subpath under `/workspaces` |
535
+
| `X-Claude-Continue` | Set to `1`/`true`/`yes` to continue the previous session |
536
+
537
+
**LiteLLM example:**
538
+
539
+
```python
540
+
import litellm
541
+
542
+
response = litellm.completion(
543
+
model="openai/haiku",
544
+
messages=[{"role": "user", "content": "hello"}],
545
+
api_base="http://localhost:8080/openai/v1",
546
+
api_key="your-secret-token", # or any string if no token set
547
+
)
548
+
print(response.choices[0].message.content)
549
+
```
550
+
551
+
#### MCP server
552
+
553
+
The API also exposes an MCP (Model Context Protocol) server at `/mcp` using streamable HTTP transport. Any MCP-compatible client (Claude Desktop, Claude Code, etc.) can connect to it.
| `claude_run` | Run a prompt through Claude. Params: `prompt`, `model`, `system_prompt`, `append_system_prompt`, `json_schema`, `workspace`, `no_continue`, `resume`, `effort` |
571
+
| `list_files` | List files/dirs in the workspace |
572
+
| `read_file` | Read a file from the workspace |
573
+
| `write_file` | Write a file to the workspace |
574
+
| `delete_file` | Delete a file from the workspace |
575
+
503
576
### Telegram mode
504
577
505
578
Talk to Claude from Telegram. Each chat gets its own workspace and settings. Send text, files, photos, videos, voice messages. Run shell commands. Get files back.
0 commit comments