Use this guide when an AI agent needs to onboard without browser prompts.
Prerequisites
- Base URL:
https://apigcp.trynia.ai/v2
nia-wizard installed or runnable with npx.
Flow Overview
New Users
- Create account with
POST /v2/auth/signup — returns a read-only API key and sends a 6-digit verification code to email.
- Verify the account with
POST /v2/auth/verify — upgrades the API key to full access.
- Install Nia skill in non-interactive mode using
nia-wizard skill add.
Returning Users
- Request a verification code with
POST /v2/auth/login.
- Exchange the code for a full-access API key with
POST /v2/auth/login/verify.
Create Account (API-First)
curl -sS -X POST "https://apigcp.trynia.ai/v2/auth/signup" \
-H "Content-Type: application/json" \
-d '{
"email": "agent@example.com",
"organization_name": "Agent Org",
"first_name": "Agent",
"last_name": "Runner",
"idempotency_key": "signup-agent-001"
}'
Response includes:
api_key (read-only until verified)
api_key_id
user_id
organization_id
verified (false)
Verify Account
Use the 6-digit code sent to your email:
curl -sS -X POST "https://apigcp.trynia.ai/v2/auth/verify" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <read-only-api-key>" \
-d '{
"code": "123456"
}'
On success, the API key is upgraded from read-only to full access.
Returning User Login (Passwordless)
Step 1: Request verification code
curl -sS -X POST "https://apigcp.trynia.ai/v2/auth/login" \
-H "Content-Type: application/json" \
-d '{
"email": "agent@example.com"
}'
Step 2: Exchange code for API key
curl -sS -X POST "https://apigcp.trynia.ai/v2/auth/login/verify" \
-H "Content-Type: application/json" \
-d '{
"email": "agent@example.com",
"code": "123456"
}'
Response includes a fresh api_key with full access.
Install Nia Skill Non-Interactively
npx nia-wizard skill add \
--api-key "<api-key-from-auth-endpoint>" \
--source nozomio-labs/nia-skill \
--non-interactive \
--ci
Optional target pinning:
npx nia-wizard skill add \
--api-key "<api-key-from-auth-endpoint>" \
--target codex \
--non-interactive \
--ci
End-To-End Script (Headless)
#!/usr/bin/env bash
set -euo pipefail
BASE_URL="https://apigcp.trynia.ai/v2"
EMAIL="agent@example.com"
ORG_NAME="Agent Org"
# Step 1: Sign up (returns read-only API key)
SIGNUP_JSON=$(curl -sS -X POST "$BASE_URL/auth/signup" \
-H "Content-Type: application/json" \
-d "{\"email\":\"$EMAIL\",\"organization_name\":\"$ORG_NAME\"}")
API_KEY=$(echo "$SIGNUP_JSON" | jq -r '.api_key')
# Step 2: Verify with email code (upgrades key to full access)
read -rp "Enter 6-digit verification code: " CODE
curl -sS -X POST "$BASE_URL/auth/verify" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_KEY" \
-d "{\"code\":\"$CODE\"}"
# Step 3: Install skill
npx nia-wizard skill add --api-key "$API_KEY" --non-interactive --ci
Handle credentials and generated API keys as secrets. Do not print them to shared logs.
Reference
See API Reference for these endpoints:
POST /auth/signup
POST /auth/verify
POST /auth/login
POST /auth/login/verify
POST /auth/resend-code