Quick Start Guide

Get up and running with the Zaits API in under 5 minutes. This guide will walk you through making your first API call.

Before You Start

  1. Sign up for a free account at zaits.net

  2. Generate your API key (see Authentication Guide)

  3. Choose your method: cURL, JavaScript, Python, or our SDKs

Your First API Call

Let's start with a simple face verification request to see if two photos contain the same person.

Option 1: Using cURL

curl -X POST https://api.zaits.net/v1/face/verify \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "image1=@/path/to/first_photo.jpg" \
  -F "image2=@/path/to/second_photo.jpg"

Option 2: Using JavaScript/Node.js

const FormData = require('form-data');
const fs = require('fs');
const fetch = require('node-fetch');

async function verifyFaces() {
  const formData = new FormData();
  formData.append('image1', fs.createReadStream('first_photo.jpg'));
  formData.append('image2', fs.createReadStream('second_photo.jpg'));

  try {
    const response = await fetch('https://api.zaits.net/v1/face/verify', {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY'
      },
      body: formData
    });

    const result = await response.json();
    console.log('Verification result:', result);
  } catch (error) {
    console.error('Error:', error.message);
  }
}

verifyFaces();

Option 3: Using Python

import requests

# Verify faces
with open('first_photo.jpg', 'rb') as img1, open('second_photo.jpg', 'rb') as img2:
    response = requests.post(
        'https://api.zaits.net/v1/face/verify',
        headers={'Authorization': 'Bearer YOUR_API_KEY'},
        files={
            'image1': img1,
            'image2': img2
        }
    )

    result = response.json()
    print(f"Match: {result['data']['verified']}")
    print(f"Confidence: {result['data']['confidence']}")

Expected Response

All methods above will return a similar response:

{
  "success": true,
  "data": {
    "verified": true,
    "confidence": 0.89,
    "distance": 0.32,
    "threshold": 0.6,
    "processing_time": 1.2
  }
}

Understanding the Response

Field
Description

verified

true if faces match, false if they don't

confidence

Confidence score (0-1, higher is more confident)

distance

Face distance metric (lower means more similar)

threshold

The threshold used for verification decision

processing_time

Time taken to process (in seconds)

Try More APIs

Now that you've made your first call, try these other popular endpoints:

OCR Text Extraction

Extract text from any document:

curl -X POST https://api.zaits.net/v1/ocr/extract \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "[email protected]"

Face Analysis

Get age, gender, and emotion analysis:

curl -X POST https://api.zaits.net/v1/face/analyze \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "image=@face_photo.jpg" \
  -F "actions=[\"age\", \"gender\", \"emotion\"]"

Face Matching (1:1 and 1:n)

Enroll faces and search for matches across your database:

Enroll a face:

curl -X POST https://api.zaits.net/v1/face-matching/enroll \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "image=@user_photo.jpg" \
  -F "enrollment_source=registration" \
  -F "metadata={\"label\":\"Employee ID Badge\"}"

Search for matches (1:n identification):

curl -X POST https://api.zaits.net/v1/face-matching/search \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "image=@unknown_person.jpg" \
  -F "threshold=0.6" \
  -F "limit=10"

Verify against specific user (1:1 verification):

curl -X POST https://api.zaits.net/v1/face-matching/verify/USER_ID \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "image=@person_to_verify.jpg" \
  -F "threshold=0.6"

Create a Signing Document

Create a document for electronic signatures:

curl -X POST https://api.zaits.net/v1/signing/documents \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "[email protected]" \
  -F "title=Service Agreement" \
  -F "signers=[{\"email\":\"[email protected]\",\"name\":\"John Doe\"}]"

Common First-Time Issues

❌ "Invalid API Key" Error

Problem: Your API key is incorrect or missing Solution:

  1. Double-check your API key in the dashboard

  2. Ensure you're using the correct key format (sk_...)

  3. Make sure the Authorization: Bearer header is included

❌ "File Too Large" Error

Problem: Image file exceeds the 5MB limit Solution:

  1. Compress your image files

  2. Use formats like JPEG with reasonable quality settings

  3. Resize images to appropriate dimensions (max 2048x2048 recommended)

❌ "Unsupported File Type" Error

Problem: File format is not supported Solution:

  1. Use supported formats: JPG, JPEG, PNG, WebP

  2. For documents: PDF, JPG, PNG

  3. Check the file extension matches the actual file type

❌ "Permission Denied" Error

Problem: Your API key doesn't have the required permissions Solution:

  1. Go to your dashboard → API Keys

  2. Edit your key and enable "Write" permissions

  3. Save changes and retry your request

Rate Limits for New Users

Free accounts have these limits:

  • 100 requests per hour

  • 1,000 requests per month

  • 5MB max file size

You'll see these headers in responses:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 99
X-RateLimit-Reset: 1642251600

Next Steps

🎉 Congratulations! You've made your first Zaits API call. Here's what to explore next:

Learn the APIs

Integration Guides

Code Examples


Ready to build something amazing? Start integrating Zaits into your application!

Last updated