> For the complete documentation index, see [llms.txt](https://docs.claret.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.claret.app/api-reference/utilities/create-a-new-api-token.md).

# Create a new API token

```json
{"openapi":"3.1.0","info":{"title":"Claret","version":"1.0.0"},"tags":[{"name":"Utilities","description":"Token management, credit top-up, and asynchronous job status."}],"servers":[{"url":"https://plan.claret.app/{tenant}/api/v1","description":"Production","variables":{"tenant":{"default":"your-tenant","description":"Your Claret tenant identifier (the slug in your Claret URL)."}}}],"security":[{"http":[]}],"components":{"securitySchemes":{"http":{"type":"http","scheme":"bearer"}},"schemas":{"CreateTokenRequest":{"type":"object","properties":{"name":{"type":"string","maxLength":255},"expires_at":{"type":"string","format":"date-time"},"scopes":{"type":"array","items":{"type":"string","enum":["*","public_api.read","public_api.write","public_api.compute","public_api.workflow","public_api.workflow.replace"]},"minItems":1}},"required":["name"],"title":"CreateTokenRequest"}},"responses":{"AuthenticationException":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error overview."}},"required":["message"]}}}},"ValidationException":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Errors overview."},"errors":{"type":"object","description":"A detailed description of each field that failed validation.","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["message","errors"]}}}}}},"paths":{"/tokens":{"post":{"operationId":"tenant.public.tokens.store","summary":"Create a new API token","tags":["Utilities"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTokenRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","const":"API token created successfully. Store the plain_text_token securely — it will not be shown again."},"data":{"type":"array","prefixItems":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"plain_text_token":{"type":"string"},"abilities":{"type":"string"},"expires_at":{"type":"string"},"created_at":{"type":"string"}},"required":["id","name","plain_text_token","abilities","expires_at","created_at"]}],"minItems":1,"maxItems":1,"additionalItems":false},"meta":{"anyOf":[{"type":"array","items":{}},{"type":"string"}]},"links":{"type":"string"}},"required":["message","data","meta","links"]}}}},"401":{"$ref":"#/components/responses/AuthenticationException"},"403":{"description":"","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","const":"https://httpstatuses.com/403"},"title":{"type":"string","const":"Forbidden"},"status":{"type":"integer","const":403},"detail":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"string"}},"required":["type","title","status","detail","request_id","errors"]}}}},"422":{"$ref":"#/components/responses/ValidationException"},"500":{"description":"","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","const":"https://httpstatuses.com/500"},"title":{"type":"string","const":"Internal Server Error"},"status":{"type":"integer","const":500},"detail":{"type":"string","const":"An unexpected error occurred while creating the token."},"request_id":{"type":"string"},"errors":{"type":"string"}},"required":["type","title","status","detail","request_id","errors"]}}}}}}}}}
```
