Skip to content
Tracon

TraconEndpointRouteBuilderExtensions

Namespace Tracon · Assembly Tracon.AspNetCore.dll

Extensions that connect Tracon’s HTTP surface to the application.

public static class TraconEndpointRouteBuilderExtensions

objectTraconEndpointRouteBuilderExtensions

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Default path prefix.

public const string DefaultPrefix = "/tracon"

string

MapTracon(IEndpointRouteBuilder, string, Action<TraconEndpointOptions>?)

Section titled “ MapTracon(IEndpointRouteBuilder, string, Action<TraconEndpointOptions>?)”

Connects the Tracon management API and the OpenAI-compatible run endpoints.

public static IEndpointConventionBuilder MapTracon(this IEndpointRouteBuilder endpoints, string prefix = "/tracon", Action<TraconEndpointOptions>? configure = null)

endpoints IEndpointRouteBuilder

The application’s routing builder.

prefix string

Path prefix. Default is /tracon.

configure Action<TraconEndpointOptions>?

Hook that mutates access and streaming settings.

IEndpointConventionBuilder

The convention builder for the protected endpoints. Every convention added only applies to the protected endpoints.

Endpoints fall into two groups. {prefix}/api/meta is reachable without authentication; it is needed for the UI to learn which authentication method to use and returns no sensitive data. Every other endpoint passes through the three-layer protection.

The returned builder represents only the protected group. This is deliberate: if the meta endpoint were also locked when the caller writes MapTracon(...).RequireAuthorization, the UI could never learn the authentication method and could never open a session.

app.MapTracon("/tracon", options =>
{
options.RequireAuthorization("TraconAdmin");
});

ArgumentNullException

endpoints is null.

ArgumentException

prefix is empty.

InvalidOperationException

AddTracon has not been called.