Skip to main content

Presign API

Generate signed URLs for LLM provider access.

Endpoint: POST /v1/presign

Base URL: https://scost.arakoo.com

Request Headers

HeaderValue
AuthorizationBearer YOUR_API_KEY
Content-Typeapplication/json

Request Body

FieldTypeRequiredDescription
providerstringYesTarget provider (openai, anthropic, google, cohere, groq, etc.)
pathstring or string[]YesAllowed API path(s) (e.g., /v1/chat/completions)
client_api_keystringNo*Your provider API key. Encrypted at rest.
virtual_keystringNo*Use pre-configured key instead of client_api_key.
methodstringNoAllowed HTTP method. Default: POST
expires_innumberNoValidity in seconds. -1 = 1 year. Default: 3600
max_usesnumberNoMax calls allowed. -1 = unlimited. Default: -1
cost_limitnumberNoMax spend in microdollars ($1 = 1,000,000 microdollars)
configobjectNoProvider config overrides (model, max_tokens, etc.)
external_sessionstringNoYour session identifier (max 255 chars)
external_userstringNoYour user identifier for billing (max 255 chars)
session_idstring (uuid)NoCustom session UUID. Auto-generated if not provided.
metadataobjectNoCustom JSON metadata (max 64KB)
note

Either client_api_key or virtual_key must be provided.

Response

{
"url": "https://scost-gateway.arakoo.com/stringcost-proxy/t/TOKEN/v1/chat/completions",
"session_id": "550e8400-e29b-41d4-a716-446655440000",
"expires_at": 1735689600
}

Example Request

curl -X POST https://scost.arakoo.com/v1/presign \
-H "Authorization: Bearer ${API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"provider": "openai",
"path": "/v1/chat/completions",
"client_api_key": "sk-...",
"expires_in": 3600,
"max_uses": 100
}'