# copenapi **Repository Path**: zhushizhang/copenapi ## Basic Information - **Project Name**: copenapi - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-03-10 - **Last Updated**: 2026-03-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # copenapi (Spring Boot MVP) A Java/Spring Boot gateway that provides OpenAI-compatible endpoints and routes requests to copenclaw. ## Stack - Java 21 - Spring Boot 3.3 - Spring Security (API key auth) - Spring Data JPA + Flyway - PostgreSQL + Redis ## Endpoints - `POST /v1/chat/completions` - `POST /v1/chat/completions/stream` - `POST /v1/embeddings` - `POST /admin/api-keys` (create new key for current user) - `GET /admin/billing/balance` (query current user balance) - `POST /admin/model-routes` (upsert route, requires `X-Admin-Token`) ## Local run 1. Create PostgreSQL database `copenapi` and update `application.yml` credentials. 2. Ensure Redis is available at `localhost:6379`. 3. Run: ```bash mvn spring-boot:run ``` ## Auth Use `Authorization: Bearer `. Database stores `api_keys.key_hash` as SHA-256 hash. ## Seed Data (for quick test) - Seed user: `admin@copenapi.local` - Seed API key (raw): `sk-copenapi-admin-dev-2026` - Seed balance: `100 USD` ## Next steps - Replace stream mock with true provider streaming passthrough. - Implement Redis Bucket4j RPM/TPM limits. - Add admin APIs for key management and route management.