stable-diffusion-aws-extension/docs/en/developer-guide/api_authentication.md

821 B

Security Authentication

All APIs use API keys for security verification, and all API requests should include your API key in the HTTP header. The x-api-key is as follows:

X-api-key: 09876743201987654321

User Authentication

Please include username in the HTTP header. For example, if the username configured on WebUI is admin, then:

username: admin

Version 1.4.0 or earlier

Your Authorization should be included in the HTTP header as follows:

Authorization: Bearer {TOKEN}

Token algorithm (Python example):

Import base64
Username="your username on webui"
Token=base64.b16encode (username. encode ("utf-8")). decode ("utf-8")

For example, if the username configured on WebUI is admin, then:

Authorization: Bearer 61646D696E