Make your first AI Studio API call¶
This quickstart uses the CloudSigma AI Studio HTTP API to list the workspaces available to your account, then lists workflows in one workspace.
Before you begin¶
For regional endpoints, credentials, and workspace configuration, see Endpoints & Authentication.
Prepare the following values:
Regional API base URL: Use the endpoint for the region that contains your workspace. For Manila 2 (
mnl2), usehttps://genai.mnl2.cloudsigma.com/v5.Personal access token: Create and copy a token from Access credentials in the CloudSigma console.
curl: Use curl 7.61.0 or later to run the examples.
Store the endpoint and token in environment variables. Replace the example values with your own:
export CLOUDSIGMA_API_BASE='https://genai.mnl2.cloudsigma.com/v5'
export CLOUDSIGMA_API_KEY='<your-personal-access-token>'
Keep tokens out of source code, terminal output, and shared command history.
1. List available workspaces¶
Send a request to list the workspaces available to the current identity:
curl --get "$CLOUDSIGMA_API_BASE/workspaces" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY"
A successful request returns 200. Copy a workspace ID from data.workspaces[].id, then store it for the next request:
export CLOUDSIGMA_WORKSPACE_ID='<workspace-id-from-the-response>'
For all request and response fields, see List workspaces.
2. List workflows in the workspace¶
Workspace-scoped requests require both the personal access token and the workspace ID:
curl --get "$CLOUDSIGMA_API_BASE/workflow/v2/workflow-apps?offset=0&limit=20" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $CLOUDSIGMA_WORKSPACE_ID"
A successful request returns 200. The workflow list is in data.workflows, and data.total contains the total number of matching workflows.
For all request and response fields, see List workflows.
Troubleshooting¶
Response |
What to check |
|---|---|
|
Confirm that the personal access token is complete and is passed in |
|
Confirm that the caller is a member of the target workspace and has permission to read the resource. |
|
Confirm that |
Empty list |
Confirm that you selected the expected region and workspace. An empty list can also mean that no matching resource has been created. |