Skip to content

Add OpenAI-compatible API endpoint #54

Closed

Description

@pavelanni

Summary

Add an OpenAI-compatible /v1/chat/completions endpoint to DocsClaw so users can connect existing chat UIs (Open WebUI, LibreChat, TypingMind, etc.) instead of building a custom web frontend.

Motivation

  • DocsClaw has a TUI chat interface, good for testing but not for business users
  • A2A-compatible web UI clients don't appear to exist yet
  • OpenAI's chat completions API is a de facto standard with many compatible frontends
  • Implementing the API is significantly less effort than building a full web UI
  • When deployed on OpenShift, users just need the endpoint URL to configure their preferred client

Key design points

  • Thin translation layer: Accept OpenAI-format messages, inject DocsClaw's system prompt and tools behind the scenes, run the agentic loop, return OpenAI-format responses
  • Endpoints needed: /v1/chat/completions (main), /v1/models (model listing)
  • Streaming: Support SSE streaming (stream: true) for real-time token output
  • Tool-call transparency: Tool execution happens server-side; optionally surface tool-call deltas in streaming responses for clients that render them
  • Coexist with A2A: Handlers sit alongside existing serve command endpoints
  • No external dependencies: OpenAI request/response types are simple Go structs

Out of scope (initially)

  • /v1/embeddings, /v1/images, other OpenAI endpoints
  • Authentication/API key management (can be added later)
  • Multi-model selection (DocsClaw proxies to its configured LLM provider)

Activity

  1. added a commit that references this issue on May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions