mirror of
https://github.com/Routstr/routstr-core.git
synced 2026-10-05 20:28:23 +00:00
clean up & add docs
This commit is contained in:
@@ -434,6 +434,42 @@ Authorization: Bearer sk-...
|
||||
}
|
||||
```
|
||||
|
||||
### Create Child Key
|
||||
|
||||
Creates one or more child API keys that share the parent's balance. Each child key creation costs a fixed amount (configurable).
|
||||
|
||||
```http
|
||||
POST /v1/balance/child-key
|
||||
Authorization: Bearer sk-...
|
||||
```
|
||||
|
||||
**Request Body:**
|
||||
|
||||
```json
|
||||
{
|
||||
"count": 1
|
||||
}
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `count` | integer | Yes | - | Number of child keys to create (1-50) |
|
||||
|
||||
**Response:**
|
||||
|
||||
```json
|
||||
{
|
||||
"api_keys": ["sk-abc...", "sk-def..."],
|
||||
"count": 2,
|
||||
"cost_msats": 2000,
|
||||
"cost_sats": 2,
|
||||
"parent_balance": 98000,
|
||||
"parent_balance_sats": 98
|
||||
}
|
||||
```
|
||||
|
||||
## Provider Discovery
|
||||
|
||||
## Admin Settings
|
||||
|
||||
@@ -310,7 +310,6 @@ async def create_child_key(
|
||||
|
||||
response_data = {
|
||||
"api_keys": new_keys,
|
||||
"api_key": new_keys[0], # For backward compatibility
|
||||
"count": count,
|
||||
"cost_msats": total_cost,
|
||||
"cost_sats": total_cost // 1000,
|
||||
|
||||
@@ -65,8 +65,6 @@ export function ChildKeyCreator({
|
||||
|
||||
if (result.api_keys && result.api_keys.length > 0) {
|
||||
setNewKeys(result.api_keys);
|
||||
} else if (result.api_key) {
|
||||
setNewKeys([result.api_key]);
|
||||
} else {
|
||||
throw new Error('No API keys returned from server');
|
||||
}
|
||||
|
||||
@@ -44,7 +44,6 @@ export interface WithdrawResponse {
|
||||
|
||||
export interface CreateChildKeyResponse {
|
||||
api_keys: string[];
|
||||
api_key: string;
|
||||
count: number;
|
||||
cost_msats: number;
|
||||
cost_sats: number;
|
||||
|
||||
Reference in New Issue
Block a user