---
title: "Deploy EmpirioLabs AI Agent"
description: "An AI agent for EmpirioLabs AI models and tools, built with Next.js."
category: "AI/ML"
url: https://railway.com/deploy/empiriolabs-ai-agent
---

# Deploy EmpirioLabs AI Agent

An AI agent for EmpirioLabs AI models and tools, built with Next.js.

**[Deploy EmpirioLabs AI Agent on Railway](https://railway.com/template/empiriolabs-ai-agent)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/empiriolabs-ai-agent/manifest.json

- **Creator:** EmpirioLabs.ai Dev
- **Category:** AI/ML

## Template content

### empiriolabs-agent https://empiriolabs.ai/images/icon-512.png

- **Source:** EmpirioLabs-AI/empiriolabs-agent
- **Health check:** /api/health
- **Public domain:** Yes

## Documentation

# Deploy and Host EmpirioLabs AI Agent on Railway

EmpirioLabs AI Agent is an open-source AI agent for EmpirioLabs AI. Chat with any text model in the live EmpirioLabs AI catalog, and let the agent use EmpirioLabs AI tools: generate images, video, 3D assets, speech and music, transcribe audio, read documents, search the web and more. It is built with Next.js, the AI SDK and MCP.

## About Hosting EmpirioLabs AI Agent

The template deploys one Next.js service from the EmpirioLabs-AI/empiriolabs-agent repository. Railway builds the app, checks `/api/health` before each deployment goes live, and gives it a public domain. Leave `EMPIRIOLABS_API_KEY` empty, and each visitor signs in with their own EmpirioLabs AI account or continues with their own API key, so their chats and tool calls use their own credits. Set `EMPIRIOLABS_API_KEY` to use one key for every visitor, for a private deployment; the app reads it only on the server. The tools come from the live tool list of the EmpirioLabs AI MCP server, so new tools appear without a code change. `EMPIRIOLABS_MODEL` sets the model the chat starts with.

## Common Use Cases

- A private AI assistant for your team that creates images, video and speech, and searches the web
- A public AI agent where each visitor signs in with their own EmpirioLabs AI account or API key
- A starting point for your own AI agent built on Next.js, the AI SDK and MCP

## Dependencies for EmpirioLabs AI Agent Hosting

- An EmpirioLabs AI account; an API key from https://platform.empiriolabs.ai/dashboard/api-keys only for a private deployment
- Node.js 24, which Railway installs from `package.json`

### Implementation Details

The agent runs the model through the AI SDK's OpenAI-compatible provider and reads its tools from the EmpirioLabs AI MCP server with the AI SDK's MCP client:

```ts
import { createMCPClient } from "@ai-sdk/mcp";
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";

const apiKey = process.env.EMPIRIOLABS_API_KEY;

const empiriolabs = createOpenAICompatible({
  name: "empiriolabs",
  baseURL: "https://api.empiriolabs.ai/v1",
  apiKey,
});

const mcp = await createMCPClient({
  transport: {
    type: "http",
    url: "https://mcp.empiriolabs.ai/mcp/models+text+search+media+jobs+agents",
    headers: { Authorization: `Bearer ${apiKey}` },
  },
});
```

## Why Deploy EmpirioLabs AI Agent on Railway?


Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying EmpirioLabs AI Agent on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.



## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [Weaviate](https://railway.com/deploy/weaviate-1) — Vector database with hybrid search and an API key-protected API
- [Möbius v0.1 Personal AI OS](https://railway.com/deploy/mobius-v01-personal-ai-os) — Self-hosted AI agent that builds and runs apps for you, with memory.

Open this page in a browser: https://railway.com/deploy/empiriolabs-ai-agent
