Skip to main content
Learn how to authenticate and make your first API calls to Dev Kit for AI Cloud API. This guide walks you through registration, authentication, and common operations with real code examples from a developer’s perspective.

Prerequisites

Before you begin, you’ll need:
  • A web browser to access Cloud Admin
  • A terminal or command-line interface
  • curl installed (or any HTTP client like Postman, Insomnia)
  • A text editor for storing credentials
This guide uses curl for examples, but you can use any HTTP client. All examples use the VibeCoding.ad API server (api.vibecoding.ad).

Step 1: Register as Developer

Create your developer account via the Cloud Admin web interface. This is the easiest way to get started.
  1. Visit https://vibecoding.ad/register/developer or https://devkit4ai.com/register/developer
  2. Fill in your email and password (minimum 8 characters with uppercase, lowercase, and digit)
  3. Click “Create Developer Account”
  4. You’ll receive your provisioning credentials on the success page
(((REPLACE_THIS_WITH_IMAGE: cloud-admin-developer-registration-form.png: Screenshot of Cloud Admin developer registration page with email, password, and create account button)))

Provisioning Credentials

After successful registration, you’ll receive three critical credentials:
Save these credentials immediately! They are shown only once:
  • developer_key: Authenticates your developer-level API calls
  • project_id: Your auto-created default project UUID
  • api_key: Your default project’s API key for end user operations
Store them securely:

Alternative: API Registration (Advanced)

If you prefer programmatic registration, you can use the API directly with an operator key:
Operator keys are only available for platform operators. For most developers, Cloud Admin registration is the recommended approach.

Step 2: Login and Get JWT Token

Use your email and password to obtain a JWT access token for API calls:

Response

Store your access token - you’ll need it for authenticated requests. Access tokens expire after 30 minutes. Save to environment:
(((REPLACE_THIS_WITH_IMAGE: cloud-api-quickstart-authentication-flow.png: Diagram showing Cloud Admin registration through login to API usage with JWT tokens)))

Step 3: Verify Your Identity

Confirm your authentication by fetching your user profile:

Response

Step 4: Create Your First Project

Now create a new project for your application:

Response

Save the project id - you’ll use it to create project-specific API keys.

Step 5: Generate Project API Key

Create an API key for your project to authenticate end user requests:

Response

Save the full key immediately! The complete key value is shown only once. You’ll use this key in your Starter Kit application to authenticate end user requests.

Step 6: Make Your First AI Generation Request

Now test the AI generation endpoint:

Response

Step 7: Check Generation Status

Poll the status endpoint to check when your generation completes:

Response (Completed)

(((REPLACE_THIS_WITH_IMAGE: cloud-api-quickstart-generation-status-polling.png: Diagram showing status progression from pending → processing → completed with example response for each status)))

Common Error Patterns

Understanding common errors helps you debug issues quickly.

Authentication Errors

Missing or Invalid JWT Token

Solution: Ensure your JWT token is valid and not expired. Use the Refresh Token endpoint to obtain a new access token.

Missing Role Header

Solution: Add the X-User-Role header with appropriate value (platform_operator, developer, or end_user).

Invalid Developer Key

Solution: Verify your developer key is active via List Developer Keys. Generate a new key if needed.

Validation Errors

Invalid Email Format

Solution: Ensure email follows standard format: user@domain.com.

Weak Password

Solution: Use passwords with minimum 8 characters including uppercase, lowercase, and at least one digit.

Rate Limiting

Too Many Requests

Solution: Implement exponential backoff. Wait for the duration specified in retry_after before retrying.

Resource Errors

Project Not Found

Solution: Verify the project ID exists and belongs to your developer account via List Projects.

Insufficient Permissions

Solution: Ensure you’re using the correct role headers and the resource belongs to your account.

Troubleshooting Guide

JWT Token Expired

Symptom: Receiving 401 Unauthorized after some time. Cause: Access tokens expire after 30 minutes. Solution:

Headers Not Working

Symptom: 403 Forbidden despite including headers. Checklist:
  • ✅ Header names are exact (case-sensitive): X-User-Role, X-Developer-Key, X-Project-ID, X-API-Key
  • ✅ Role value matches your user type exactly: developer, end_user, platform_operator
  • ✅ Keys are not expired or revoked
  • ✅ Project ID is a valid UUID format
  • ✅ All required headers for your role are present

Generation Stuck in Pending

Symptom: Generation status remains pending for a long time. Normal Duration: Generations typically complete within 2-5 minutes. Troubleshooting:
  1. Wait at least 5 minutes before investigating
  2. Check Cloud Admin console for system status
  3. Verify example images were uploaded correctly (JPEG, PNG, or WebP; max 10MB each)
  4. Contact support if status remains pending after 10 minutes

Project API Key Not Working

Symptom: End user requests fail with 403 Forbidden. Required Headers for End User Requests:
Verification:

Best Practices

Secure Credential Storage

Never hardcode API keys in your code or commit them to version control.
Do:
  • Store credentials in environment variables
  • Use secrets managers (AWS Secrets Manager, HashiCorp Vault)
  • Rotate keys every 90 days
  • Use different keys for each environment (dev, staging, production)
Don’t:
  • Hardcode keys in source code
  • Share keys via email or chat
  • Use the same key across multiple environments
  • Store keys in public repositories

Error Handling

Implement robust error handling for production applications:

Token Refresh Strategy

Implement automatic token refresh before expiration:

Polling Strategy

When polling for generation status, use exponential backoff:

Next Steps

Clone Starter Kit

Get the open-source template for your application

Cloud Admin Console

Manage projects and keys via web interface

Authentication Guide

Implement user authentication in your app

API Reference

Complete API endpoint documentation

Example Application

Here’s a complete Node.js example putting it all together:
Before running: Register via Cloud Admin to obtain your initial credentials (developer key, project ID, and project API key). Replace the placeholder values in the code with your actual credentials.
Save this as quickstart-example.js and run:

Summary

You’ve learned how to: ✅ Register as a developer and obtain credentials
✅ Authenticate with JWT tokens
✅ Create projects and generate API keys
✅ Make AI generation requests
✅ Handle common errors and implement best practices
Ready to build? Clone the Starter Kit and start creating your AI-powered application!