published on Tuesday, Nov 3, 2026 by Pydantic
published on Tuesday, Nov 3, 2026 by Pydantic
Manages an organization-owned AI Gateway endpoint and the providers it routes to. Requires Growth, Enterprise Cloud, or self-hosted and a token with organization:read_gateway and organization:write_gateway scopes (organization:read and organization:write are also accepted). Endpoints that use built-in providers or more than 100 providers are not supported. Import accepts the endpoint UUID or its organization-unique slug.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as logfire from "@pydantic/pulumi-logfire";
const _default = new logfire.GatewayEndpoint("default", {
slug: "default",
description: "Prefer OpenAI and fall back to Anthropic.",
providers: [
{
provider_id: logfire_gateway_provider.openai.id,
priority: 10,
},
{
provider_id: logfire_gateway_provider.anthropic.id,
},
],
});
import pulumi
import pulumi_logfire as logfire
default = logfire.GatewayEndpoint("default",
slug="default",
description="Prefer OpenAI and fall back to Anthropic.",
providers=[
{
"provider_id": logfire_gateway_provider["openai"]["id"],
"priority": 10,
},
{
"provider_id": logfire_gateway_provider["anthropic"]["id"],
},
])
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pydantic/pulumi-logfire/sdk/go/logfire"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := logfire.NewGatewayEndpoint(ctx, "default", &logfire.GatewayEndpointArgs{
Slug: pulumi.String("default"),
Description: pulumi.String("Prefer OpenAI and fall back to Anthropic."),
Providers: logfire.GatewayEndpointProviderArray{
&logfire.GatewayEndpointProviderArgs{
Provider_id: logfire_gateway_provider.Openai.Id,
Priority: pulumi.Int(10),
},
&logfire.GatewayEndpointProviderArgs{
Provider_id: logfire_gateway_provider.Anthropic.Id,
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Logfire = Pulumi.Logfire;
return await Deployment.RunAsync(() =>
{
var @default = new Logfire.GatewayEndpoint("default", new()
{
Slug = "default",
Description = "Prefer OpenAI and fall back to Anthropic.",
Providers = new[]
{
new Logfire.Inputs.GatewayEndpointProviderArgs
{
Provider_id = logfire_gateway_provider.Openai.Id,
Priority = 10,
},
new Logfire.Inputs.GatewayEndpointProviderArgs
{
Provider_id = logfire_gateway_provider.Anthropic.Id,
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.logfire.GatewayEndpoint;
import com.pulumi.logfire.GatewayEndpointArgs;
import com.pulumi.logfire.inputs.GatewayEndpointProviderArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var default_ = new GatewayEndpoint("default", GatewayEndpointArgs.builder()
.slug("default")
.description("Prefer OpenAI and fall back to Anthropic.")
.providers(
GatewayEndpointProviderArgs.builder()
.provider_id(logfire_gateway_provider.openai().id())
.priority(10)
.build(),
GatewayEndpointProviderArgs.builder()
.provider_id(logfire_gateway_provider.anthropic().id())
.build())
.build());
}
}
resources:
default:
type: logfire:GatewayEndpoint
properties:
slug: default
description: Prefer OpenAI and fall back to Anthropic.
providers:
- provider_id: ${logfire_gateway_provider.openai.id}
priority: 10
- provider_id: ${logfire_gateway_provider.anthropic.id}
Example coming soon!
Routing
providers is the complete set of providers the endpoint routes to. The Gateway
tries providers with a higher priority first. Providers with the same priority
are tried in a random order that follows their weight. An inactive provider
stays assigned but receives no requests. At least one provider must be active.
A change to any provider replaces the whole set in one request, so the endpoint
never routes to a partial configuration. Logfire stores weight as a 32-bit
float. The provider keeps the configured value when it matches what Logfire stored.
If a routing policy uses a provider, the API refuses to remove or pause it. Update the routing policy first.
If the organization has a provider with the same slug as the endpoint, the API refuses to delete the endpoint with a conflict error, because that provider would then be reachable directly. Remove that provider first, then destroy the endpoint.
Failed creates
Creation is not retried automatically. A failed request can still leave an endpoint stored. Check the endpoint list before retrying. If the slug exists, import it by slug and apply the configuration again. A conflicting slug is never adopted automatically.
Supported configuration
The resource manages endpoints whose providers all belong to the organization. Endpoints that use a built-in provider, or more than 100 providers, return a conflict error. Manage those in the Logfire UI.
Create GatewayEndpoint Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new GatewayEndpoint(name: string, args: GatewayEndpointArgs, opts?: CustomResourceOptions);@overload
def GatewayEndpoint(resource_name: str,
args: GatewayEndpointArgs,
opts: Optional[ResourceOptions] = None)
@overload
def GatewayEndpoint(resource_name: str,
opts: Optional[ResourceOptions] = None,
providers: Optional[Sequence[GatewayEndpointProviderArgs]] = None,
slug: Optional[str] = None,
description: Optional[str] = None)func NewGatewayEndpoint(ctx *Context, name string, args GatewayEndpointArgs, opts ...ResourceOption) (*GatewayEndpoint, error)public GatewayEndpoint(string name, GatewayEndpointArgs args, CustomResourceOptions? opts = null)
public GatewayEndpoint(String name, GatewayEndpointArgs args)
public GatewayEndpoint(String name, GatewayEndpointArgs args, CustomResourceOptions options)
type: logfire:GatewayEndpoint
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "logfire_gateway_endpoint" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args GatewayEndpointArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args GatewayEndpointArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args GatewayEndpointArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args GatewayEndpointArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args GatewayEndpointArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var gatewayEndpointResource = new Logfire.GatewayEndpoint("gatewayEndpointResource", new()
{
Providers = new[]
{
new Logfire.Inputs.GatewayEndpointProviderArgs
{
ProviderId = "string",
Active = false,
Priority = 0,
Weight = 0.0,
},
},
Slug = "string",
Description = "string",
});
example, err := logfire.NewGatewayEndpoint(ctx, "gatewayEndpointResource", &logfire.GatewayEndpointArgs{
Providers: logfire.GatewayEndpointProviderArray{
&logfire.GatewayEndpointProviderArgs{
ProviderId: pulumi.String("string"),
Active: pulumi.Bool(false),
Priority: pulumi.Int(0),
Weight: pulumi.Float64(0),
},
},
Slug: pulumi.String("string"),
Description: pulumi.String("string"),
})
resource "logfire_gateway_endpoint" "gatewayEndpointResource" {
lifecycle {
create_before_destroy = true
}
_ {
providers {
provider_id = "string"
active = false
priority = 0
weight = 0
}
}
slug = "string"
description = "string"
}
var gatewayEndpointResource = new GatewayEndpoint("gatewayEndpointResource", GatewayEndpointArgs.builder()
.providers(GatewayEndpointProviderArgs.builder()
.providerId("string")
.active(false)
.priority(0)
.weight(0.0)
.build())
.slug("string")
.description("string")
.build());
gateway_endpoint_resource = logfire.GatewayEndpoint("gatewayEndpointResource",
providers=[{
"provider_id": "string",
"active": False,
"priority": 0,
"weight": float(0),
}],
slug="string",
description="string")
const gatewayEndpointResource = new logfire.GatewayEndpoint("gatewayEndpointResource", {
providers: [{
providerId: "string",
active: false,
priority: 0,
weight: 0,
}],
slug: "string",
description: "string",
});
type: logfire:GatewayEndpoint
properties:
description: string
providers:
- active: false
priority: 0
providerId: string
weight: 0
slug: string
GatewayEndpoint Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The GatewayEndpoint resource accepts the following input properties:
- Providers
List<Gateway
Endpoint Provider> - Complete set of providers the endpoint routes to. A change replaces the whole set in one request. At least one provider must be active.
- Slug string
- Organization-unique endpoint slug. Changing it replaces the endpoint.
- Description string
- Endpoint description.
- Providers
[]Gateway
Endpoint Provider Args - Complete set of providers the endpoint routes to. A change replaces the whole set in one request. At least one provider must be active.
- Slug string
- Organization-unique endpoint slug. Changing it replaces the endpoint.
- Description string
- Endpoint description.
- providers list(object)
- Complete set of providers the endpoint routes to. A change replaces the whole set in one request. At least one provider must be active.
- slug string
- Organization-unique endpoint slug. Changing it replaces the endpoint.
- description string
- Endpoint description.
- providers
List<Gateway
Endpoint Provider> - Complete set of providers the endpoint routes to. A change replaces the whole set in one request. At least one provider must be active.
- slug String
- Organization-unique endpoint slug. Changing it replaces the endpoint.
- description String
- Endpoint description.
- providers
Gateway
Endpoint Provider[] - Complete set of providers the endpoint routes to. A change replaces the whole set in one request. At least one provider must be active.
- slug string
- Organization-unique endpoint slug. Changing it replaces the endpoint.
- description string
- Endpoint description.
- providers
Sequence[Gateway
Endpoint Provider Args] - Complete set of providers the endpoint routes to. A change replaces the whole set in one request. At least one provider must be active.
- slug str
- Organization-unique endpoint slug. Changing it replaces the endpoint.
- description str
- Endpoint description.
- providers List<Property Map>
- Complete set of providers the endpoint routes to. A change replaces the whole set in one request. At least one provider must be active.
- slug String
- Organization-unique endpoint slug. Changing it replaces the endpoint.
- description String
- Endpoint description.
Outputs
All input properties are implicitly available as output properties. Additionally, the GatewayEndpoint resource produces the following output properties:
- created_
at string - Timestamp when the endpoint was created.
- id string
- The provider-assigned unique ID for this managed resource.
- created_
at str - Timestamp when the endpoint was created.
- id str
- The provider-assigned unique ID for this managed resource.
Look up Existing GatewayEndpoint Resource
Get an existing GatewayEndpoint resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: GatewayEndpointState, opts?: CustomResourceOptions): GatewayEndpoint@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
created_at: Optional[str] = None,
description: Optional[str] = None,
providers: Optional[Sequence[GatewayEndpointProviderArgs]] = None,
slug: Optional[str] = None) -> GatewayEndpointfunc GetGatewayEndpoint(ctx *Context, name string, id IDInput, state *GatewayEndpointState, opts ...ResourceOption) (*GatewayEndpoint, error)public static GatewayEndpoint Get(string name, Input<string> id, GatewayEndpointState? state, CustomResourceOptions? opts = null)public static GatewayEndpoint get(String name, Output<String> id, GatewayEndpointState state, CustomResourceOptions options)resources: _: type: logfire:GatewayEndpoint get: id: ${id}import {
to = logfire_gateway_endpoint.example
id = "${id}"
}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Created
At string - Timestamp when the endpoint was created.
- Description string
- Endpoint description.
- Providers
List<Gateway
Endpoint Provider> - Complete set of providers the endpoint routes to. A change replaces the whole set in one request. At least one provider must be active.
- Slug string
- Organization-unique endpoint slug. Changing it replaces the endpoint.
- Created
At string - Timestamp when the endpoint was created.
- Description string
- Endpoint description.
- Providers
[]Gateway
Endpoint Provider Args - Complete set of providers the endpoint routes to. A change replaces the whole set in one request. At least one provider must be active.
- Slug string
- Organization-unique endpoint slug. Changing it replaces the endpoint.
- created_
at string - Timestamp when the endpoint was created.
- description string
- Endpoint description.
- providers list(object)
- Complete set of providers the endpoint routes to. A change replaces the whole set in one request. At least one provider must be active.
- slug string
- Organization-unique endpoint slug. Changing it replaces the endpoint.
- created
At String - Timestamp when the endpoint was created.
- description String
- Endpoint description.
- providers
List<Gateway
Endpoint Provider> - Complete set of providers the endpoint routes to. A change replaces the whole set in one request. At least one provider must be active.
- slug String
- Organization-unique endpoint slug. Changing it replaces the endpoint.
- created
At string - Timestamp when the endpoint was created.
- description string
- Endpoint description.
- providers
Gateway
Endpoint Provider[] - Complete set of providers the endpoint routes to. A change replaces the whole set in one request. At least one provider must be active.
- slug string
- Organization-unique endpoint slug. Changing it replaces the endpoint.
- created_
at str - Timestamp when the endpoint was created.
- description str
- Endpoint description.
- providers
Sequence[Gateway
Endpoint Provider Args] - Complete set of providers the endpoint routes to. A change replaces the whole set in one request. At least one provider must be active.
- slug str
- Organization-unique endpoint slug. Changing it replaces the endpoint.
- created
At String - Timestamp when the endpoint was created.
- description String
- Endpoint description.
- providers List<Property Map>
- Complete set of providers the endpoint routes to. A change replaces the whole set in one request. At least one provider must be active.
- slug String
- Organization-unique endpoint slug. Changing it replaces the endpoint.
Supporting Types
GatewayEndpointProvider, GatewayEndpointProviderArgs
- Provider
Id string - UUID of a
logfire.GatewayProviderin the same organization. - Active bool
- Whether the Gateway routes to this provider. Defaults to true.
- Priority int
- The Gateway tries providers with a higher priority first. Providers with the same priority are tried in a random order that follows their weights. Defaults to 0.
- Weight double
- Positive relative weight among providers with the same priority. Defaults to 1.
- Provider
Id string - UUID of a
logfire.GatewayProviderin the same organization. - Active bool
- Whether the Gateway routes to this provider. Defaults to true.
- Priority int
- The Gateway tries providers with a higher priority first. Providers with the same priority are tried in a random order that follows their weights. Defaults to 0.
- Weight float64
- Positive relative weight among providers with the same priority. Defaults to 1.
- provider_
id string - UUID of a
logfire.GatewayProviderin the same organization. - active bool
- Whether the Gateway routes to this provider. Defaults to true.
- priority number
- The Gateway tries providers with a higher priority first. Providers with the same priority are tried in a random order that follows their weights. Defaults to 0.
- weight number
- Positive relative weight among providers with the same priority. Defaults to 1.
- provider
Id String - UUID of a
logfire.GatewayProviderin the same organization. - active Boolean
- Whether the Gateway routes to this provider. Defaults to true.
- priority Integer
- The Gateway tries providers with a higher priority first. Providers with the same priority are tried in a random order that follows their weights. Defaults to 0.
- weight Double
- Positive relative weight among providers with the same priority. Defaults to 1.
- provider
Id string - UUID of a
logfire.GatewayProviderin the same organization. - active boolean
- Whether the Gateway routes to this provider. Defaults to true.
- priority number
- The Gateway tries providers with a higher priority first. Providers with the same priority are tried in a random order that follows their weights. Defaults to 0.
- weight number
- Positive relative weight among providers with the same priority. Defaults to 1.
- provider_
id str - UUID of a
logfire.GatewayProviderin the same organization. - active bool
- Whether the Gateway routes to this provider. Defaults to true.
- priority int
- The Gateway tries providers with a higher priority first. Providers with the same priority are tried in a random order that follows their weights. Defaults to 0.
- weight float
- Positive relative weight among providers with the same priority. Defaults to 1.
- provider
Id String - UUID of a
logfire.GatewayProviderin the same organization. - active Boolean
- Whether the Gateway routes to this provider. Defaults to true.
- priority Number
- The Gateway tries providers with a higher priority first. Providers with the same priority are tried in a random order that follows their weights. Defaults to 0.
- weight Number
- Positive relative weight among providers with the same priority. Defaults to 1.
Import
Import an endpoint by slug or UUID using the same organization’s management token:
terraform
import {
to = logfire_gateway_endpoint.default
id = “default”
}
Or use the command line:
Import an existing Gateway endpoint by its organization-unique slug, or by its UUID.
By slug:
$ pulumi import logfire:index/gatewayEndpoint:GatewayEndpoint default' "default"
By UUID:
$ pulumi import logfire:index/gatewayEndpoint:GatewayEndpoint default' "018f45c0-3cab-7b2f-a8f7-8a0b55a7ed00"
An import leaves priority, weight, and active null when Logfire reports
their defaults. If your configuration spells out a default, such as
weight = 1, the first plan after the import shows a change. Applying it sends
the same providers again and changes nothing.
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- logfire pydantic/pulumi-logfire
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
logfireTerraform Provider.
published on Tuesday, Nov 3, 2026 by Pydantic