Authentication & Essentials
Authentication (Bearer Token)
Using cURL
Authorization: Bearer YOUR_API_TOKENcurl --request GET \
--url "https://shortgenius.com/api/v1/health" \
--header "Authorization: Bearer YOUR_API_TOKEN"Using SDKs
import { ShortGenius } from 'shortgenius'
const client = new ShortGenius({
bearerAuth: 'YOUR_API_TOKEN'
})
// The SDK automatically includes the bearer token in all requests
const status = await client.status.check()// SDK will automatically use SHORTGENIUS_BEARER_AUTH env variable
const client = new ShortGenius({
bearerAuth: process.env.SHORTGENIUS_BEARER_AUTH
})from shortgenius import Shortgenius
client = Shortgenius(api_key="YOUR_API_TOKEN")
// The SDK automatically includes the API key in all requests
status = client.status.check()import os
// SDK will automatically use SHORTGENIUS_API_KEY env variable
client = Shortgenius(
api_key=os.environ.get("SHORTGENIUS_API_KEY")
)Handling Errors
Status Code
Meaning
Example Message
SDK Error Handling
Rate Limits & Credits
Checking Your Credit Balance
Last updated