iotype-ai / sdk
Official PHP SDK for iotype (iotype.com) — Persian, English and Arabic speech recognition, OCR, translation and text-to-speech.
Requires
- php: >=7.4
- ext-curl: *
- ext-json: *
Suggests
- textalk/websocket: Required for realtime ASR streaming (^1.5)
README
iotype API
Persian, English and Arabic speech recognition, OCR, translation and text-to-speech — over one small HTTP API.
official iotype API documentation · OpenAPI spec · AsyncAPI spec · فارسی
What this repository is
Everything you need to integrate iotype: machine-readable API specs, task-oriented guides in English and Persian, runnable examples, and official SDKs for Python, JavaScript/TypeScript, PHP and Go.
If you are an AI coding assistant, start with AGENTS.md.
Services
| Service | Kind | Endpoint | Guide |
|---|---|---|---|
| Realtime ASR | WebSocket stream | wss://iotype.com/socket/realtime |
docs |
| Instant transcription | sync | POST /io/v1/transcribe/instant |
docs |
| Transcription | async | POST /io/v1/transcribe |
docs |
| OCR | async | POST /io/v1/ocr |
docs |
| Translation | sync | POST /io/v1/translate |
docs |
| Text to speech | sync | POST /io/v1/synthesis |
docs |
| List files | sync | POST /io/v1/files |
docs |
| Track a file | sync | POST /io/v1/file/track |
docs |
All HTTP endpoints are POST and live under https://iotype.com.
Quickstart
Get a token from your iotype API dashboard. New accounts start with 300 free tokens.
export IOTYPE_TOKEN="your-token-here" curl -X POST https://iotype.com/io/v1/translate \ -H "Authorization: Bearer $IOTYPE_TOKEN" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -H "X-Requested-With: XMLHttpRequest" \ -d '{"source_lang":"fa","destination_lang":"en","text":"سلام دنیا"}'
{ "result": "Hello world" }
SDKs
| Python |
from iotype import Iotype io = Iotype() # reads IOTYPE_TOKEN print(io.translate("سلام دنیا", "fa", "en")) |
| JavaScript |
import { Iotype } from "@iotype-ai/sdk"; const io = new Iotype(); console.log(await io.translate("سلام دنیا", "fa", "en")); |
| PHP |
$io = new Iotype\Client(); echo $io->translate('سلام دنیا', 'fa', 'en'); |
| Go |
io, _ := iotype.New("") // New returns (*Client, error) out, _ := io.Translate(ctx, "سلام دنیا", "fa", "en") |
Installation and full API surface: sdk/.
Published as iotype-ai on every registry. On PyPI, pip install iotype also
works — see sdk/aliases/.
Authentication
Every request carries a bearer token:
Authorization: Bearer <TOKEN>
For real-time ASR from a browser or mobile app, mint a short-lived Flash Token on your server and hand that to the client instead — never ship your Access Token to code you do not control.
A Flash Token is scoped to the realtime ASR WebSocket and nothing else; no HTTP endpoint accepts one. Transcription, OCR, translation and text-to-speech therefore have no client-side credential and must be called from your server. See docs/en/authentication.md.
Billing
Usage is metered in tokens. Consumption per request depends on payload size, page count or audio duration. Failed requests are not billed. Packages are listed at iotype.com/plans/api.
Repository layout
spec/ OpenAPI 3.1 and AsyncAPI 3.0 definitions — the source of truth
docs/en/ Task-oriented guides, English
docs/fa/ Task-oriented guides, Persian
examples/curl/ One runnable shell script per endpoint
examples/browser-asr/ Tested browser client for the realtime ASR protocol
postman/ Importable Postman collection
sdk/python/ Official Python SDK
sdk/javascript/ Official JavaScript/TypeScript SDK
sdk/php/ Official PHP SDK (its composer.json is at the repo root — see below)
sdk/go/ Official Go SDK
sdk/aliases/ PyPI alias so `pip install iotype` also works
site/ Source of the GitHub Pages documentation site
composer.json PHP package manifest; Packagist only reads the root one
.gitattributes Keeps non-PHP files out of the Composer download
PUBLISHING.md Release runbook for every registry
AGENTS.md Instructions for AI coding assistants
llms.txt Machine-readable index for LLMs
Known documentation gaps
These are not yet published upstream and are marked x-unverified in the spec. Contributions confirming them are welcome.
- The endpoint that mints a Flash Token, and its response shape and TTL
- Exact
processes[].statusvalues - HTTP status codes and error body beyond
401 - Rate limits, max upload size, max audio duration, max page count
- Token cost per page, per audio minute and per character
About iotype
iotype (Persian: آی او تایپ) provides AI and natural-language services for Persian, English and Arabic without requiring your own ML infrastructure. Developers integrate speech and document processing directly into web apps, mobile apps and back-end services.
| realtime voice typing API | Streaming Persian speech-to-text over WebSocket |
| audio transcription API | Convert MP3 recordings to text, with optional summaries |
| Persian OCR API | Extract text from scanned PDFs and images |
| machine translation API | Persian ⇄ English ⇄ Arabic |
| text-to-speech API | Eleven Persian voices, two delivery tones |
| API pricing | Token-based; 300 free tokens on signup |
Full service documentation lives at iotype.com/api-service. This repository mirrors it in a machine-readable form and adds SDKs.
Releasing
Registry-by-registry runbook: PUBLISHING.md.
License
MIT — see LICENSE.
Maintained by iotype · iotype API documentation · Get an API token · API pricing