Skip to main content

Overview

Semantic Kernel can call TokenLab through its OpenAI custom endpoint chat completion service.
Type: SDK / Agent FrameworkPrimary Path: OpenAI-compatible chat completionsSupport Confidence: Supported custom endpoint path

Environment

export TOKENLAB_API_KEY="sk-your-tokenlab-key"

.NET Kernel Builder

Semantic Kernel’s custom endpoint should point to the root OpenAI-compatible /v1 endpoint, not /v1/chat/completions.
using Microsoft.SemanticKernel;

#pragma warning disable SKEXP0010

var builder = Kernel.CreateBuilder();

builder.AddOpenAIChatCompletion(
    modelId: "gpt-5.4-mini",
    endpoint: new Uri("https://api.tokenlab.sh/v1"),
    apiKey: Environment.GetEnvironmentVariable("TOKENLAB_API_KEY"));

var kernel = builder.Build();

Basic Prompt

var result = await kernel.InvokePromptAsync(
    "Give me a concise checklist for evaluating an LLM gateway.");

Console.WriteLine(result);

Endpoint Notes

Use:
https://api.tokenlab.sh/v1
Do not use:
https://api.tokenlab.sh/v1/chat/completions
Semantic Kernel appends the chat completions path internally for this connector.