ไปที่เนื้อหา
DeepTokenชุดสร้างสรรค์ด้วย AI
หน้าแรกแดชบอร์ดโมเดลกระดานผู้นำเอกสารราคาองค์กรบล็อก
    เริ่มต้นอย่างรวดเร็ว

    Introduction

    • เริ่มต้นใช้งาน
    • เริ่มต้นอย่างรวดเร็ว
    • การผสานรวม

    API

    • การยืนยันตัวตน
    • การเติมข้อความแชท
    • โมเดล
    • ข้อผิดพลาด

    Billing

    • การเรียกเก็บเงิน
    • องค์กร

    Introduction

    • เริ่มต้นใช้งาน
    • เริ่มต้นอย่างรวดเร็ว
    • การผสานรวม

    API

    • การยืนยันตัวตน
    • การเติมข้อความแชท
    • โมเดล
    • ข้อผิดพลาด

    Billing

    • การเรียกเก็บเงิน
    • องค์กร

    Quickstart

    Every DeepToken endpoint is OpenAI-compatible. If you already have working OpenAI code, you only need to change two lines: the base URL and the API key.

    Code Examples

    Select your language of choice to initialize the client and make a request:

    from openai import OpenAI
    
    client = OpenAI(
        api_key="$DEEPTOKEN_API_KEY",
        base_url="https://api.deeptoken.app/v1",
    )
    
    resp = client.chat.completions.create(
        model="gpt-4o-mini",
        messages=[{"role": "user", "content": "Hi"}],
    )
    print(resp.choices[0].message.content)
    

    Streaming

    Pass stream: true for an SSE stream. Streaming is metered on the same path as non-streaming requests — every token is counted, every call lands in the usage ledger.

    Other endpoints

    The gateway routes all common OpenAI-compatible endpoints:

    • POST /v1/chat/completions
    • POST /v1/completions
    • POST /v1/embeddings
    • POST /v1/moderations
    • POST /v1/images/generations
    • POST /v1/audio/speech
    • POST /v1/audio/transcriptions
    • POST /v1/audio/translations
    • GET /v1/models

    Pick the model in the request body; the gateway picks the channel.

    Previous

    เริ่มต้นใช้งาน

    Next

    การผสานรวม

    ในหน้านี้

    • Code Examples
    • Streaming
    • Other endpoints