Developer Documentation

Quick Start Guide

1. Get Your API Key

Your API key is available on your dashboard. Click your profile to see and copy it.

2. Make Your First Request

Include your API key in the X-API-Key header with every request:

# Chat with A1 AI curl -X POST "https://atscloudplatform.com/v1/chat/simple" \ -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"message": "What is Unity?"}'

3. Available Services

STT
Speech-to-Text: Convert audio to text
TTS
Text-to-Speech: Convert text to audio
Chat
Chat: Get intelligent responses from A1
S2S
Speech-to-Speech: Talk to A1 directly

4. Audio Formats

Input: WAV (recommended), MP3, WebM

Output: MP3 (audio/mpeg)

Note: The Unity SDK handles audio recording and format conversion automatically.

5. Base URLs

Environment URL
Development http://192.168.1.167:8000
Production https://atscloudplatform.com

API Reference

All endpoints require the X-API-Key header for authentication.

Core Services

POST /v1/stt

Convert audio to text (Speech-to-Text)

Body: Multipart form with audio file (WAV, MP3, WebM)

Response: {"text": "transcribed text", "confidence": 0.95}

POST /v1/tts

Convert text to speech (Text-to-Speech)

Body: {"text": "Hello world", "voice": "en-US-GuyNeural"}

Response: MP3 audio file

Available Voices:

  • en-US-GuyNeural (US Male) - Default
  • en-US-JennyNeural (US Female)
  • en-US-AriaNeural (US Female)
  • en-US-DavisNeural (US Male)
  • en-GB-RyanNeural (UK Male)
  • en-GB-SoniaNeural (UK Female)
  • en-IN-NeerjaNeural (Indian Female)
  • en-IN-PrabhatNeural (Indian Male)
POST /v1/speech-to-speech

Complete voice conversation (Audio Input -> A1 Response Audio)

Body: Multipart form with audio file, voice, and service_type

Parameters:
service_type = "chat" | "mock-interview" | "english-tutor"
topic = Interview topic (optional, for mock-interview)
session_id = Session ID (optional)

Response: MP3 audio file with transcription text in headers

POST /v1/chat/simple

Chat with A1 AI

Body: {"message": "your question"}

Response: {"response": "AI answer"}

Orchestration Services

POST /v1/mock-interview/start

Start a mock interview session

Body: {"topic": "AR/VR Development"}

Response: {"session_id": "...", "interviewer_greeting": "..."}

POST /v1/mock-interview/feedback

Get feedback for a mock interview session

Body: {"session_id": "..."}

Response: {"feedback": "...", "questions_asked": 5}

POST /v1/speech-to-speech/feedback

Get feedback for an S2S mock interview session

Body (Form): session_id

Response: {"feedback": "...", "questions_asked": 5}

POST /v1/english-tutor/session/start

Start an English tutoring session

POST /v1/voice-assistant/query

Ask the voice assistant a question

Other

GET /health

Check API health status (no auth required)

GET /v1/tts/voices

List available TTS voices (no auth required)

Open Full API Documentation (Swagger)

Unity Integration

1. Download the SDK

Add ATSCloudAPI.cs to your Unity project's Scripts folder.

Download ATSCloudAPI.cs

2. Setup

  1. Create an empty GameObject in your scene
  2. Attach the ATSCloudAPI script to it
  3. Set your API key in the Inspector
  4. Change baseUrl to production when deploying

3. Speech-to-Text

// Get reference to the component ATSCloudAPI atsCloud = GetComponent<ATSCloudAPI>(); // Subscribe to transcription event atsCloud.OnTranscriptionComplete += (text) => { Debug.Log("User said: " + text); }; // Start recording (5 seconds by default) atsCloud.StartSpeechToText();

4. Text-to-Speech

// Subscribe to TTS event atsCloud.OnTTSComplete += (audioClip) => { AudioSource.PlayClipAtPoint(audioClip, transform.position); }; // Convert text to speech atsCloud.TextToSpeech("Hello, welcome to the AR experience!");

5. Chat with A1

// Subscribe to chat response event atsCloud.OnChatResponseReceived += (response) => { Debug.Log("A1 says: " + response); }; // Send a message atsCloud.SendChat("What is augmented reality?");

6. Speech-to-Speech (Talk to A1)

// Subscribe to S2S completion atsCloud.OnSpeechToSpeechComplete += (audio, userText, aiText) => { audioSource.clip = audio; audioSource.Play(); Debug.Log($"User: {userText}, AI: {aiText}"); }; // Start recording with specific service ("chat", "mock-interview", "english-tutor") atsCloud.StartSpeechToSpeech("en-US-GuyNeural", "mock-interview");

7. Get Feedback

// Subscribe to feedback event atsCloud.OnFeedbackReceived += (feedback) => { Debug.Log("Feedback: " + feedback); }; // Get feedback (S2S) atsCloud.GetS2SFeedback(sessionId); // Get feedback (Normal Mock Interview) atsCloud.GetMockInterviewFeedback(sessionId);

8. URL Configuration

// Development (local testing) atsCloud.baseUrl = "http://192.168.1.167:8000"; // Production (after domain deployment) atsCloud.baseUrl = "https://atscloudplatform.com";

Code Examples

cURL - Speech to Text

curl -X POST "https://atscloudplatform.com/v1/stt" \ -H "X-API-Key: YOUR_API_KEY" \ -F "audio=@recording.wav"

cURL - Text to Speech

curl -X POST "https://atscloudplatform.com/v1/tts" \ -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"text": "Hello world", "voice": "en-US-GuyNeural"}' \ --output speech.mp3

cURL - Speech to Speech

curl -X POST "https://atscloudplatform.com/v1/speech-to-speech" \ -H "X-API-Key: YOUR_API_KEY" \ -F "audio=@recording.wav" \ -F "voice=en-US-GuyNeural" \ -F "service_type=mock-interview" \ --output response.mp3

cURL - Chat

curl -X POST "https://atscloudplatform.com/v1/chat/simple" \ -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"message": "Explain virtual reality in simple terms"}'

Python

import requests API_KEY = "YOUR_API_KEY" BASE_URL = "https://atscloudplatform.com" # Chat example response = requests.post( f"{BASE_URL}/v1/chat/simple", headers={"X-API-Key": API_KEY}, json={"message": "What is Unity?"} ) print(response.json()["response"])

JavaScript (Fetch)

const API_KEY = 'YOUR_API_KEY'; const BASE_URL = 'https://atscloudplatform.com'; // Chat example fetch(`${BASE_URL}/v1/chat/simple`, { method: 'POST', headers: { 'X-API-Key': API_KEY, 'Content-Type': 'application/json' }, body: JSON.stringify({ message: 'What is Unity?' }) }) .then(res => res.json()) .then(data => console.log(data.response));

Need help? Contact your institute administrator or email support@atscloudplatform.com