Skip to main content

    Documentation

    Everything you need to build with Behest: the unified AI backend with Token FinOps and Enterprise AI Governance.

    Quickstart

    TypeScript / JavaScript

    npm install openai
    import OpenAI from "openai";
    
    const client = new OpenAI({
      baseURL: "https://api.behest.ai/v1",
      apiKey: "your-api-key",
      defaultHeaders: {
        "X-End-User-Id": userId,
        // Uniquely identifies a conversation thread for per-session cost attribution.
        "X-Session-Id": `user-${userId}-conv-${conversationId}`,
      },
    });
    
    const completion = await client.chat.completions.create({
      model: "gemini-2.5-flash",
      messages: [{ role: "user", content: userMessage }],
    });
    
    console.log(completion.choices[0].message.content);

    Python

    Coming Soon
    pip install openai
    from openai import OpenAI
    
    client = OpenAI(
        base_url="https://api.behest.ai/v1",
        api_key="your-api-key",
        default_headers={
            "X-End-User-Id": user_id,
            # Uniquely identifies a conversation thread for per-session cost attribution.
            "X-Session-Id": f"user-{user_id}-conv-{conversation_id}",
        },
    )
    
    completion = client.chat.completions.create(
        model="gemini-2.5-flash",
        messages=[{"role": "user", "content": user_message}],
    )
    
    print(completion.choices[0].message.content)

    cURL

    POST /v1/chat/completions
    curl -X POST https://api.behest.ai/v1/chat/completions \
      -H "Authorization: Bearer your-api-key" \
      -H "Content-Type: application/json" \
      -H "X-End-User-Id: user-12345" \
      -H "X-Session-Id: user-12345-conv-abc" \
      -d '{
        "model": "gemini-2.5-flash",
        "messages": [
          {"role": "user", "content": "Summarize this document"}
        ]
      }'

    Enterprise Controls

    Framework Quickstarts

    API Reference

    Developer Reference

    Guides

    SDKs & Tools

    @behest/client-ts

    TypeScript/JavaScript SDK for Behest. Works in Node.js, Deno, Bun, and browsers.

    behest-ai

    Python SDK for Behest. Async-first, type-safe, and compatible with the OpenAI Python SDK.

    OpenAPI Spec

    Full OpenAPI 3.1 specification for the Behest API. Import into Postman, Insomnia, or generate your own client.

    Community

    Enterprise Token FinOps: Enforce hard budgets and attribute costs per session.

    Learn more