SDK Documentation

SDK Reference

Integrate TechStone AI Cloud into your applications with our official SDKs. Supports Python, Node.js, Go, and REST API with unified interface across all providers.

Quick Start

1

Get your API key

Sign up at the Console and generate an API key. New users get $5 free credits.

2

Install the SDK

pip install techstoneai
3

Initialize and make your first request

Python
from techstoneai import TechStoneAI

client = TechStoneAI(
    api_key="your-api-key-here"
)

Chat Completions

Send messages to any supported model using our unified API. The interface is consistent across all providers.

Installation

Python
pip install techstoneai

Basic Chat

Python
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "What is the Token economy?"}
    ],
    temperature=0.7,
    max_tokens=1024
)

print(response.choices[0].message.content)
print(f"Tokens used: {response.usage.total_tokens}")

Streaming Response

Python
stream = client.chat.completions.create(
    model="gpt-4o",
    messages=[
        {"role": "user", "content": "Explain quantum computing"}
    ],
    stream=True
)

for chunk in stream:
    if chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="")

Supported Models

GPT-4o

OpenAI

GPT-4o Mini

OpenAI

Claude 3.7 Sonnet

Anthropic

Claude 3.5 Haiku

Anthropic

Gemini Pro

Google

Gemini Flash

Google

DeepSeek V3

DeepSeek

StoneCloud Fast

StoneCloud

Access 40+ models through a single API. View all models and pricing →

Advanced Topics

API Parameters Reference

ParameterTypeDefaultDescription
modelstringRequiredModel ID to use (e.g., "gpt-4o", "claude-3.7-sonnet")
messagesarrayRequiredArray of message objects with role and content
temperaturenumber0.7Sampling temperature (0.0 - 2.0). Lower = more focused
max_tokensintegernullMaximum tokens to generate in the completion
top_pnumber1.0Nucleus sampling parameter. Use temperature or top_p, not both
streambooleanfalseIf true, returns partial message deltas in real-time
stopstring/arraynullUp to 4 sequences where the API will stop generating
frequency_penaltynumber0Penalize new tokens based on frequency (-2.0 to 2.0)
presence_penaltynumber0Penalize new tokens based on presence (-2.0 to 2.0)