Documentation
Authentication
Create an API key and send it as a bearer token with every request.
Every request authenticates with an API key of your workspace. The workspace's credits pay for its calls.
Send Your Key
Send the key in the Authorization header.
curl https://api.socialapi.sh/v1/credits \
-H "Authorization: Bearer $SOCIALAPI_API_KEY"A missing, revoked or expired key returns 401 UNAUTHENTICATED.
Create an API Key
Open API Keys in the dashboard and create a key. Copy it now, because it is shown only once. Every workspace also starts with a key named "Default", shown on Overview until you copy it.
| Setting | Options |
|---|---|
| Name | Up to 80 characters, to tell keys apart |
| Expires | After 7, 30, 90 or 365 days, or never |
| Monthly limit | The most credits the key may spend in a calendar month (UTC), or none |
A call that would pass the key's monthly limit returns 402 KEY_CREDIT_LIMIT_REACHED until the month turns. It costs nothing.
Manage Keys
Keys start with sapi_, and only a hash of each is stored, so a lost key cannot be shown again. Create a new one instead. A workspace can have 50 active keys, and Logs and Usage show each one's requests and spend.
Members revoke the keys they created, and admins and the owner revoke any key. A revoked key stops at once, and removing a member revokes the keys they created.
Keep Keys on Your Server
A key spends your workspace's credits. Call the API from your server, a script or a job, never from a web page or an app on a user's device. Revoke a key that leaked and create a new one.
AI Agents
An agent can connect to the MCP Server with OAuth instead of a key you copy. It gets a key of its own, named after it, such as "Claude (MCP)", which you revoke like any other.