ส่วนของฐานความรู้ ▾
สำหรับผู้เริ่มต้น
สำหรับนักลงทุน
- มูลค่าของโทเค็น GNK มาจากไหน
- Gonka กับคู่แข่ง: Render, Akash, io.net
- Libermans: จากชีวฟิสิกส์สู่ AI แบบกระจายอำนาจ
- โทเค็นโนมิคส์ของ GNK
- ความเสี่ยงและโอกาสของ Gonka: การวิเคราะห์เชิงวัตถุประสงค์
- Gonka vs Render Network: การเปรียบเทียบโดยละเอียด
- Gonka vs Akash: AI inference vs คอนเทนเนอร์
- Gonka vs io.net: inference vs marketplace GPU
- Gonka vs Bittensor: การเปรียบเทียบเชิงลึกสองแนวทางสู่ AI
- Gonka vs Flux: สองแนวทางสู่การขุดที่มีประโยชน์
- การกำกับดูแลใน Gonka: เครือข่ายกระจายอำนาจได้รับการบริหารจัดการอย่างไร
เทคนิค
การวิเคราะห์
เครื่องมือ
- Cursor + Gonka AI - LLM ราคาถูกสำหรับการเขียนโค้ด
- Claude Code + Gonka AI - LLM สำหรับเทอร์มินัล
- OpenClaw + Gonka AI - เอเจนต์ AI ที่เข้าถึงได้
- OpenCode + Gonka AI - AI ฟรีสำหรับโค้ด
- Continue.dev + Gonka AI - AI สำหรับ VS Code/JetBrains
- Cline + Gonka AI - เอเจนต์ AI ใน VS Code
- Aider + Gonka AI - การเขียนโปรแกรมคู่กับ AI
- LangChain + Gonka AI - แอปพลิเคชัน AI ในราคาที่ถูกมาก
- n8n + Gonka AI - การทำงานอัตโนมัติด้วย AI ราคาถูก
- Open WebUI + Gonka AI - ChatGPT ของคุณเอง
- LibreChat + Gonka AI — open-source ChatGPT
- API เริ่มต้นอย่างรวดเร็ว — curl, Python, TypeScript
- JoinGonka Gateway — ภาพรวมโดยละเอียด
- Management Keys — SaaS บน Gonka
เครื่องมือ
API เริ่มต้นอย่างรวดเร็ว — curl, Python, TypeScript
JoinGonka Gateway ให้บริการ API ที่เข้ากันได้กับ OpenAI + Anthropic ไปยัง เครือข่าย Gonka แบบกระจายอำนาจ. โค้ดใดๆ ที่เขียนสำหรับ OpenAI API (/v1/chat/completions), ทำงานร่วมกับ Gonka ได้ — เพียงแค่เปลี่ยน base_url และ api_key. และเครื่องมือที่ใช้ Anthropic API (Claude Code) สามารถเชื่อมต่อผ่าน /v1/messages — โดยตรง, โดยไม่มีพร็อกซี.
ในบทความนี้ — ตัวอย่างโค้ดที่พร้อมใช้งานสำหรับสามเครื่องมือยอดนิยม: curl (command line), Python และ TypeScript/Node.js (รูปแบบ OpenAI). สำหรับรูปแบบ Anthropic ดู คำแนะนำ Claude Code.
สิ่งที่คุณต้องมี: API-key ของ JoinGonka (รูปแบบ jg-xxx). รับฟรีที่ gate.joingonka.ai/register พร้อมโบนัส 10M โทเค็น.
curl — คำขอจากเทอร์มินัล
วิธีที่เร็วที่สุดในการตรวจสอบการทำงานของ API — curl:
คำขอปกติ:
curl https://gate.joingonka.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer jg-your-key" \
-d '{
"model": "Qwen/Qwen3-235B-A22B-Instruct-2507-FP8",
"messages": [
{"role": "user", "content": "Gonka คืออะไร?"}
]
}'Streaming (ตอบกลับเป็นส่วนๆ):
curl https://gate.joingonka.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer jg-your-key" \
-d '{
"model": "Qwen/Qwen3-235B-A22B-Instruct-2507-FP8",
"messages": [
{"role": "user", "content": "เขียน hello world ด้วย Python"}
],
"stream": true
}'การตอบกลับมาในรูปแบบ JSON (ปกติ) หรือ Server-Sent Events (streaming) — เข้ากันได้สมบูรณ์กับ OpenAI API
Python — openai SDK
OpenAI Python SDK อย่างเป็นทางการทำงานร่วมกับ JoinGonka Gateway ได้โดยไม่มีการเปลี่ยนแปลง:
pip install openaiคำขอปกติ:
from openai import OpenAI
client = OpenAI(
base_url="https://gate.joingonka.ai/v1",
api_key="jg-your-key",
)
response = client.chat.completions.create(
model="Qwen/Qwen3-235B-A22B-Instruct-2507-FP8",
messages=[
{"role": "user", "content": "อธิบาย blockchain ง่ายๆ"}
],
)
print(response.choices[0].message.content)Streaming:
stream = client.chat.completions.create(
model="Qwen/Qwen3-235B-A22B-Instruct-2507-FP8",
messages=[{"role": "user", "content": "เขียนอัลกอริทึมการจัดเรียงด้วย Python"}],
stream=True,
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")Tool calling:
import json
tools = [{
"type": "function",
"function": {
"name": "get_weather",
"description": "รับสภาพอากาศในเมือง",
"parameters": {
"type": "object",
"properties": {
"city": {"type": "string", "description": "ชื่อเมือง"}
},
"required": ["city"]
}
}
}]
response = client.chat.completions.create(
model="Qwen/Qwen3-235B-A22B-Instruct-2507-FP8",
messages=[{"role": "user", "content": "สภาพอากาศในมอสโกเป็นอย่างไร?"}],
tools=tools,
)
tool_call = response.choices[0].message.tool_calls[0]
print(f"ฟังก์ชัน: {tool_call.function.name}")
print(f"อาร์กิวเมนต์: {tool_call.function.arguments}")Qwen3-235B รองรับ native tool calling — ฟังก์ชันถูกเรียกใช้ได้อย่างถูกต้อง โดยไม่ต้องแยกวิเคราะห์ข้อความตอบกลับ
TypeScript/Node.js — openai SDK
การติดตั้ง:
npm install openaiคำขอปกติ:
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://gate.joingonka.ai/v1',
apiKey: 'jg-your-key',
});
async function main() {
const response = await client.chat.completions.create({
model: 'Qwen/Qwen3-235B-A22B-Instruct-2507-FP8',
messages: [
{ role: 'user', content: 'เขียน Express.js server' },
],
});
console.log(response.choices[0].message.content);
}
main();Streaming:
const stream = await client.chat.completions.create({
model: 'Qwen/Qwen3-235B-A22B-Instruct-2507-FP8',
messages: [{ role: 'user', content: 'อธิบาย async/await' }],
stream: true,
});
for await (const chunk of stream) {
const content = chunk.choices[0]?.delta?.content || '';
process.stdout.write(content);
}Tool calling:
const response = await client.chat.completions.create({
model: 'Qwen/Qwen3-235B-A22B-Instruct-2507-FP8',
messages: [{ role: 'user', content: 'แปลง 100 USD เป็น EUR' }],
tools: [{
type: 'function',
function: {
name: 'convert_currency',
description: 'แปลงสกุลเงิน',
parameters: {
type: 'object',
properties: {
amount: { type: 'number' },
from: { type: 'string' },
to: { type: 'string' },
},
required: ['amount', 'from', 'to'],
},
},
}],
});
const toolCall = response.choices[0].message.tool_calls?.[0];
console.log(`ฟังก์ชัน: ${toolCall?.function.name}`);
console.log(`อาร์กิวเมนต์: ${toolCall?.function.arguments}`);ตัวอย่างทั้งหมดใช้ OpenAI SDK อย่างเป็นทางการ — ไม่ต้องใช้ไลบรารีเพิ่มเติม เพียงแค่แทนที่ base_url และ api_key
พารามิเตอร์ API ที่รองรับ
JoinGonka Gateway รองรับพารามิเตอร์มาตรฐานทั้งหมดของ OpenAI Chat Completions API:
| พารามิเตอร์ | ประเภท | คำอธิบาย |
|---|---|---|
model | string | โมเดล: Qwen/Qwen3-235B-A22B-Instruct-2507-FP8 |
messages | array | ประวัติข้อความ (system, user, assistant) |
stream | boolean | การสร้างแบบสตรีมมิ่ง (SSE). ค่าเริ่มต้น: false |
temperature | number | ความสร้างสรรค์ของการตอบกลับ (0.0 — 2.0) |
max_tokens | integer | ความยาวสูงสุดของการตอบกลับ (สูงสุด: 2048, ค่าเริ่มต้น: 1024) |
tools | array | คำจำกัดความฟังก์ชันสำหรับการเรียกใช้เครื่องมือ |
tool_choice | string/object | กลยุทธ์การเรียกใช้ฟังก์ชัน |
พารามิเตอร์โมเดล Qwen3-235B: หน้าต่างบริบท — 128K โทเค็น, การตอบกลับสูงสุด — 2048 โทเค็น. รายละเอียดทั้งหมด: HuggingFace. รายชื่อโมเดลสามารถดูได้ที่ GET /v1/models.
สองปลายทาง (endpoints):
- รูปแบบ OpenAI:
POST https://gate.joingonka.ai/v1/chat/completions - รูปแบบ Anthropic:
POST https://gate.joingonka.ai/v1/messages
การยืนยันตัวตน: Authorization: Bearer jg-your-key (OpenAI) หรือ x-api-key: jg-your-key (Anthropic)
รูปแบบการตอบกลับเข้ากันได้กับ OpenAI และ Anthropic อย่างสมบูรณ์ — SDK, ไลบรารี หรือเฟรมเวิร์กใดๆ ที่รองรับ OpenAI หรือ Anthropic API สามารถทำงานร่วมกับ JoinGonka Gateway ได้โดยไม่ต้องแก้ไข. Claude Code เชื่อมต่อผ่านรูปแบบ Anthropic โดยตรง.