diff --git a/RIP-01.md b/RIP-01.md index 627de1e..81ca3e9 100644 --- a/RIP-01.md +++ b/RIP-01.md @@ -2,12 +2,20 @@ Defines the HTTP proxy interface forwarding OpenAI-compatible API requests, with per-request micropayment handling via Cashu tokens. +## Basic Usage + +Routstr provides an OpenAI-compatible API interface. Basic LLM requests are made using standard `POST` requests to `/v1/chat/completions` (or other supported endpoints) with a JSON body containing the model parameters. + +Authentication and payment are handled via the `Authorization` header. The "api-key" provided in the header can be one of two things: + +1. **A Temporary Balance Key (`sk-...`)**: A standard API key linked to a pre-funded temporary wallet/balance on the server. +2. **A Cashu Token (`cashuA...`)**: A raw Cashu eCash token. The server will redeem this token to create an ephemeral session or account. + ## Endpoints ### POST /v1/{path:path} e.g. /v1/chat/completions -Forward proxied requests to the upstream AI service at `UPSTREAM_BASE_URL`. -This is usually your llamacpp or vllm server. +Forward proxied requests to the upstream service like local vLLM, OpenAI, Anthropic, etc. ### GET /v1/info diff --git a/RIP-03.md b/RIP-03.md index e3d4324..a97fb01 100644 --- a/RIP-03.md +++ b/RIP-03.md @@ -14,9 +14,10 @@ Routstr clients MUST maintain high fidelity with the OpenAI API specification to ## 2. Ephemeral Authentication (Cashu-as-Key) -Authentication and funding are unified into a single bearer-asset mechanism, preserving complete privacy through a "Rolling Identity" model. +Authentication and funding are unified into a single mechanism. The client passes either a temporary balance key (`sk-...`) or a Cashu token (`cashuA...`) in the `Authorization` header. + +For the full specification of authentication methods and token types, refer to **[RIP-01: Authorization](RIP-01.md#authorization)**. -- **Cashu Token as API Key**: The client passes a valid Cashu token (containing monetary value) in the standard API key field (e.g., `Authorization: Bearer `). - **Implicit Session**: The provider accepts this token as both payment and a temporary identity. The token's secret effectively acts as the account identifier for the duration of the operation. - **Privacy by Default**: - Upon request completion, the provider deducts the cost.