🔗Get Started

You can access the Sand.ai API Platform Console (hereinafter referred to as the Platform) through https://platform.sand.ai.

🔗Account

When accessing the Platform through https://platform.sand.ai, if you are not logged in, you will be automatically redirected to the login page. The accounts for the Platform and Magi are interconnected, and you can directly use your Magi account to log in to the open platform. However, the account management is separate. That is to say, if a Magi account is blocked for violating the user policy, it will not affect the normal use of the Platform, and vice versa.

🔗Buy credits

After login successfully, you can purchase credits package via https://platform.sand.ai/buy-credits. The billing for Magi accounts and the open platform accounts is also separate. The open API calls will not consume the credits of Magi accounts, and vice versa.

You can visit https://platform.sand.ai/general to view the remaining credits of current account and the consumption in the past 30 days.

🔗Authorization

🔗Create API Key

After login successfully, you can access the API Key management page via https://platform.sand.ai/keys. Click the "Create API Key" button to start creating an API Key. You must specify a name to help you remember the purpose of the API Key. Then click the "Confirm" button to submit the request.

The newly created API Key will be displayed on the page, ​** and it will only be shown once **​.You need to copy it and save it properly in the configuration file of your own project.

For security reasons, it is recommended that you regularly delete existing API Keys and create new ones.

官网

🔗Use API Key

After successfully obtaining the API Key, you can complete the Authentication by adding the API Key through the Authorization HTTP Header when calling the open API.

curl -X 'POST'   'http://api.sand.ai/v1/generations' 

-H 'Authorization: Bearer {YOUR_API_KEY}' 

-H 'Content-Type: application/json' 

-d '{
"aspectRatio": "1:1",
"source": {
  "type": "image",
  "content": 1234567890
},
"chunks": [
  {
    "duration": 3,
    "conditions": [
      {
        "type": "text",
        "content": "The girl start smiling"
      }
    ],
    "enablePromptEnhancement": true
  }
]
}'