API documentation
Authentication
Authentication process and client examples
We use OAuth2 authentication process with next configuration:
auth-type: client-credentials
token0endpoint: https://rask-prod.auth.us-east-2.amazoncognito.com/oauth2/token
request-type: basic
scopes:
- api/source
- api/input
- api/output
- api/limit
Python authlib + httpx example
import asyncio
from authlib.integrations.httpx_client import AsyncOAuth2Client
async def main():
client = AsyncOAuth2Client(
f"{YOUR_CLIENT_ID}",
f"{YOUR_CLIENT_SECRET}",
token_endpoint_auth_method="client_secret_post",
grant_type="client_credentials",
scope=["api/source", "api/input", "api/output", "api/limit"],
token_endpoint="https://rask-prod.auth.us-east-2.amazoncognito.com/oauth2/token",
)
await client.fetch_token()
res = await client.get("https://api.rask.ai/v1/sources/")
print(res.json())
if __name__ == "__main__":
asyncio.run(main())