For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dashboard
User GuideDeveloper GuidesAPI Reference
User GuideDeveloper GuidesAPI Reference
    • Overview
  • Runtype API
      • GETList client tokens
      • POSTCreate client token
      • GETGet client token
      • PUTUpdate client token
      • DELDelete client token
      • GETGet client token value
      • POSTRegenerate client token
      • GETList conversations for client token
Dashboard
LogoLogo
Runtype APIClient Tokens

Create client token

POST
/v1/client-tokens
POST
/v1/client-tokens
$curl -X POST https://api.runtype.com/v1/client-tokens \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "name": "Web Client Token",
> "allowedOrigins": [
> "https://app.example.com"
> ]
>}'
1{
2 "clientToken": {
3 "id": "ct_9f8e7d6c5b4a3210",
4 "name": "Web Client Token",
5 "flowIds": [
6 "flow_123abc456def"
7 ],
8 "defaultFlowId": "flow_123abc456def",
9 "agentIds": [
10 "agent_789xyz012uvw"
11 ],
12 "allowedOrigins": [
13 "https://app.example.com"
14 ],
15 "environment": "live",
16 "pinToVersion": "v1.2.3",
17 "rateLimitPerMinute": 60,
18 "rateLimitPerHour": 1000,
19 "maxMessagesPerSession": 500,
20 "sessionIdleTimeoutMinutes": 30,
21 "config": {},
22 "isActive": true,
23 "tokenPrefix": "runtype",
24 "tokenHint": "web-client",
25 "tokenValue": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
26 "lastUsedAt": "2024-06-10T15:45:00Z",
27 "createdAt": "2024-06-01T12:00:00Z",
28 "updatedAt": "2024-06-10T15:45:00Z",
29 "conversationCount": 42
30 },
31 "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
32 "warnings": [
33 {
34 "type": "info",
35 "message": "Token will expire in 30 days."
36 }
37 ]
38}

Create a new client token for browser-to-API communication. Returns the plain token value once.

Was this page helpful?
Previous

Get client token

Next
Built with

Authentication

AuthorizationBearer
API key or Clerk session token

Request

This endpoint expects an object.
namestringRequired1-255 characters
allowedOriginslist of stringsRequired
flowIdslist of stringsOptionalDefaults to []
defaultFlowIdstringOptional
agentIdslist of stringsOptionalDefaults to []
environmentenumOptionalDefaults to live
Allowed values:
pinToVersionstringOptionalDefaults to latest
rateLimitPerMinutedoubleOptional1-1000Defaults to 10
rateLimitPerHourdoubleOptional1-10000Defaults to 100
maxMessagesPerSessiondoubleOptional1-1000Defaults to 100
sessionIdleTimeoutMinutesdoubleOptional1-1440Defaults to 30
configmap from strings to anyOptionalDefaults to {}
productSurfaceIdstringOptional

Response

Created client token
clientTokenobject
tokenstring
warningslist of objects

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
500
Internal Server Error