# 0. Keep your key in an environment variable (Dashboard → Settings → API keys)
export CHAINSHIFT_API_KEY="cs_live_..."
API=https://platform-api.trychainshift.ai/api/v1/platform
# 1. Create a prompt set — once. Use the id in the response as SET_ID
curl -X POST "$API/prompt-sets" \
-H "API-Key: $CHAINSHIFT_API_KEY" -H "Content-Type: application/json" \
-d '{"name": "Questions from the Playground"}'
# 2. Register your question as a prompt — use the id in the response as PROMPT_ID
curl -X POST "$API/prompts" \
-H "API-Key: $CHAINSHIFT_API_KEY" -H "Content-Type: application/json" \
-d '{"promptSetID": "'"$SET_ID"'", "content": "Best noise-cancelling earbuds for commuting"}'
# 3. Run it on 7 AIs — use {"id": "..."} in the response as RUN_ID
curl -X POST "$API/runs" \
-H "API-Key: $CHAINSHIFT_API_KEY" -H "Content-Type: application/json" \
-d '{"promptIDs": ["'"$PROMPT_ID"'"], "models": ["NAVER_AI_BRIEFING","NAVER_AI_TAB","GOOGLE_OVERVIEW","GOOGLE_AI","GEMINI","PERPLEXITY","CHATGPT"], "region": "KR"}'
# 4. Poll until status is FINISHED (15 seconds to 2 minutes per model)
curl -H "API-Key: $CHAINSHIFT_API_KEY" "$API/runs/$RUN_ID"
# 5. Get answer text and cited sources — the 'Response' tab shows this result
curl -H "API-Key: $CHAINSHIFT_API_KEY" "$API/answers?runID=$RUN_ID"