tcloud
TypeScript SDK, CLI, and private inference agent for Tangle AI Cloud — decentralized LLM inference with operator routing, reputation-based selection, and anonymous payments via ShieldedCredits.
npm install @tangle-network/tcloud
Packages
| Package | Description | npm | |---------|-------------|-----| | @tangle-network/tcloud | SDK + CLI | [](https://www.npmjs.com/package/@tangle-network/tcloud) | | tcloud-agent | Private inference agent + Pi extension | — |
Quick Start
import { TCloud } from '@tangle-network/tcloud'
const client = new TCloud({ apiKey: 'sk-tan-...' })
// Chat
const answer = await client.ask('What is Tangle?')
// Streaming
for await (const chunk of client.askStream('Explain decentralized AI')) {
process.stdout.write(chunk)
}
const shielded = TCloud.shielded() await shielded.ask('Hello from the shadows')
## All Endpoints
The SDK covers every endpoint the router serves:
// Chat (OpenAI-compatible) await client.chat({ model: 'gpt-4o', messages: [...] }) await client.chatStream({ model: 'claude-sonnet-4-5', messages: [...] }) await client.ask('Quick question')
// Completions (legacy) await client.completions({ prompt: 'Hello,' })
// Embeddings await client.embeddings({ model: 'text-embedding-3-small', input: 'Hello world' })
// Images await client.imageGenerate({ model: 'dall-e-3', prompt: 'A cat in space' })
// Audio await client.speech({ model: 'tts-1', input: 'Hello', voice: 'alloy' }) await client.transcribe(audioBlob)
// Rerank await client.rerank({ query: 'AI', documents: ['doc1', 'doc2'] })
// Web search await client.search({ query: 'latest Tangle docs', provider: 'exa', maxResults: 5 }) await client.ask('What changed in Tangle this week?', { webSearch: { provider: 'exa', maxResults: 5 } })
// Fine-tuning await client.fineTuneCreate({ model: 'gpt-4o-mini', trainingfile: 'file-abc123' }) await client.fineTuneList()
// Batch await client.batch([{ model: 'gpt-4o', messages: [...] }]) await client.batchStatus('batch-id')