เอกสาร API
MeshTok เป็นเกตเวย์ที่เข้ากันได้กับ OpenAI 100% หากโค้ดของคุณเรียก OpenAI อยู่แล้ว คุณเพียงแค่เปลี่ยนสองสิ่ง: base URL และคีย์ API ของคุณ
1. รับคีย์ API ของคุณ
Sign in to the คอนโซล and create a token. Your key looks like sk-xxxx....
2. Base URL
เข้ากันได้กับ OpenAI (แนะนำ)
https://meshtok.com/v1 Use with OpenAI SDK, Cursor, Cline, Aider, and most tools. Covers all 175 models.
เข้ากันได้กับ Anthropic
https://meshtok.com Use with Claude Code, Anthropic SDK, and tools that require the Anthropic Messages API format.
Most users only need the OpenAI-compatible endpoint. All endpoints follow the OpenAI convention: /v1/chat/completions, /v1/models, /v1/embeddings.
3. ตัวอย่าง Python
# pip install openai from openai import OpenAI client = OpenAI( base_url="https://meshtok.com/v1", api_key="sk-your-MeshTok-key", ) # any of 175 models -same code, just change the model name resp = client.chat.completions.create( model="deepseek/deepseek-v4-pro", messages=[{"role":"user","content":"Explain quantum computing in one sentence."}], ) print(resp.choices[0].message.content)
4. ตัวอย่าง JavaScript
// npm install openai import OpenAI from "openai"; const client = new OpenAI({ baseURL: "https://meshtok.com/v1", apiKey: "sk-your-MeshTok-key", }); const resp = await client.chat.completions.create({ model: "bigmodel/glm-5.2", messages: [{ role: "user", content: "Hello!" }], }); console.log(resp.choices[0].message.content);
5. การสตรีม
Add stream: true for Server-Sent Events streaming, identical to OpenAI's format.
curl https://meshtok.com/v1/chat/completions \ -H "Authorization: Bearer sk-your-MeshTok-key" \ -H "Content-Type: application/json" \ -d '{"model":"anthropic/claude-sonnet-5","messages":[{"role":"user","content":"Hi"}],"stream":true}'
6. แสดงรายการโมเดลทั้งหมด
curl https://meshtok.com/v1/models \
-H "Authorization: Bearer sk-your-MeshTok-key" Returns the full list of 175 available model IDs. Browse them visually on the models page.
คู่มือฟีเจอร์
การตอบกลับแบบสตรีม →
เหตุการณ์ที่ส่งจากเซิร์ฟเวอร์ในรูปแบบ OpenAI รองรับ Python, JS และการแยกวิเคราะห์ SSE ดิบ
การเรียกใช้เครื่องมือและฟังก์ชัน →
ให้โมเดล 154 ตัวเรียกใช้ฟังก์ชันของคุณ รองรับลูปเอเจนต์แบบเต็มและการเรียกแบบขนาน
ผลลัพธ์ที่มีโครงสร้าง →
บังคับให้เป็น JSON ที่ถูกต้อง รองรับโหมด json_object และ json_schema ที่เข้มงวด
การป้อนภาพและวิทัศน์ →
ส่งภาพไปยังโมเดลวิทัศน์ 58 ตัว รองรับ URL, base64, OCR และหลายภาพ
การสำรองโมเดล →
การสลับอัตโนมัติข้ามห้องปฏิบัติการ รองรับรูปแบบตามลำดับและขนาน
เอเจนต์การเขียนโค้ดและ IDE →
การตั้งค่า Claude Code, Cursor, Cline, Aider, Continue, Codex
การป้อนข้อมูลแบบหลายรูปแบบ →
ภาพ เสียง วิดีโอ PDF — รองรับโมเดลหลายรูปแบบ 69 ตัว
พร้อมสร้างแล้วหรือยัง? รับคีย์ API