Skip to content

Commit 547dea6

Browse files
committed
Add API Document Page
1 parent 5047c60 commit 547dea6

31 files changed

+606
-145
lines changed

404.html

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.
41.8 KB
Loading
34.5 KB
Loading

assets/api-docs/overview.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Welcome to TensorBlock Forge
2+
3+
In today's rapidly evolving AI landscape, harnessing the best models from different providers is key to building powerful applications. However, this often means navigating a maze of different APIs, managing dozens of keys, and struggling to track costs.
4+
5+
TensorBlock Forge streamlines this complexity. It's a universal API layer for AI models that provides a single, consistent endpoint for all your development needs.
6+
7+
## One API, Endless Possibilities
8+
9+
With Forge, you can stop writing custom code for every new model you want to try.
10+
11+
- **Unify Your Integrations**: Connect to OpenAI, Anthropic, Cohere, Google, and more through a single, OpenAI-compatible API. Swap models and providers with a single line of code.
12+
- **Centralize Your Credentials**: Securely store all your provider API keys in one place. Access them all by generating a single, powerful Forge API key.
13+
- **Gain Actionable Insights**: Monitor your usage, costs, and performance across all models and providers through a unified dashboard to make smarter decisions.
14+
15+
## Choose Your Path
16+
17+
Forge is designed to fit your workflow, whether you're a solo developer or a large enterprise.
18+
19+
- **The Cloud Platform**: Get started in seconds at [forge.tensorblock.co](https://forge.tensorblock.co). We prioritize your privacy: your provider keys are securely encrypted, and we never log the content of your requests. We only use metadata to generate usage insights, so you can focus on building with peace of mind.
20+
- **The Open-Source Edge**: For maximum control and privacy, clone the repository and deploy Forge within your own environment. You own the data, you own the infrastructure. Find out more in our [Self-Hosting Guides](./self-hosting/installation.md).
21+
22+
Ready to simplify your AI development? Let's get started.

assets/api-docs/quick-start.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Quick Start
2+
3+
Welcome to TensorBlock Forge—a single drop-in endpoint that lets you call today's best large language models while keeping your existing code and development workflow intact.
4+
5+
**TL;DR** — Change your base URL to `https://api.forge.tensorblock.co/v1`, supply your Forge API Key, update model name, and you're done.
6+
7+
---
8+
9+
### 1. Connect Your Provider Keys
10+
11+
First, log in to the TensorBlock Forge dashboard at `https://forge.tensorblock.co`. Click the "Manage Provider Keys" button and add your API keys to connect your AI providers to Forge.
12+
13+
![Provider Keys List](assets/api-docs/assets/provider_list.png)
14+
15+
### 2. Create a Forge API Key
16+
17+
Next, click the large `+` button to create your first Forge key. This key allows you to access all your connected model providers through a single, OpenAI-compatible endpoint.
18+
19+
![Forge Key Generation](assets/api-docs/assets/forge_key_genertation.png)
20+
21+
Please save your Forge key in a safe place, as it will not be shown again for security reasons. If you forget to save it, don't worry—you can click the "Regenerate" button to get a new one at any time.
22+
23+
### 3. Make Your First Request
24+
25+
You can now use your Forge API key to make requests to any of your connected AI providers through our OpenAI-compatible endpoint. Remember to use the correct model name in your request so Forge can route it to the intended provider.
26+
27+
If you are not sure which model name to use, you can get a list of all available models by making a `GET` request to the `/v1/models` endpoint.
28+
29+
### 4. Going further
30+
31+
- **Streaming**: Pass `stream: true` to any request—Forge will proxy the event stream unchanged.
32+
- **Add Custom Providers**: If a provider you want to use isn't on our list, you can add it by clicking the "Add Custom Provider" button. Alternatively, you can contribute directly to our platform by submitting a pull request to our [GitHub repository](https://github.com/tensorblock/forge).
33+
- **Model Mapping**: Create custom aliases for your most-used models for simpler API calls.
34+
35+
### 5. Next steps
36+
37+
- Read the [Self-host guide](./self-hosting/installation.md) for installation details.
38+
- Check out the full [API Reference](./api-reference.html) (coming soon!).
39+
- Drop into our GitHub for help or feature requests.

assets/api-docs/self-hosting.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Self-Hosting TensorBlock Forge
2+
3+
This guide provides a simple and reliable method for self-hosting TensorBlock Forge and all its components using Docker.
4+
5+
## Prerequisites
6+
7+
- [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/) must be installed.
8+
- `git` must be installed to clone the repository.
9+
- You will need API keys for any AI providers you wish to use with Forge.
10+
11+
## How It Works
12+
13+
This setup uses Docker Compose to run three separate services in their own containers:
14+
15+
1. **The Forge Application**: The core API gateway.
16+
2. **PostgreSQL Database**: Used for storing all user and key information.
17+
3. **Redis**: Provides a high-speed cache to improve performance.
18+
19+
Using Docker Compose is the recommended way to get started, as it handles the setup and networking of all three components for you.
20+
21+
## Installation Steps
22+
23+
### 1. Clone the Repository
24+
25+
First, get the source code from GitHub.
26+
27+
```bash
28+
git clone https://github.com/tensorblockai/forge.git
29+
cd forge
30+
```
31+
32+
### 2. Configure Your Environment
33+
34+
Forge is configured using environment variables. An example file is provided, which you should copy to create your own configuration.
35+
36+
```bash
37+
cp .env.example .env
38+
```
39+
40+
Now, open the new `.env` file in an editor and configure the following required variables:
41+
42+
- `API_KEY_ENCRYPTION_KEY`: A secret key used to encrypt provider API keys in the database.
43+
- `JWT_SECRET_KEY`: A secret key for signing user session tokens.
44+
45+
You can generate secure values for these keys by running the following commands:
46+
47+
```bash
48+
echo "API_KEY_ENCRYPTION_KEY=$(openssl rand -base64 32)" >> .env
49+
echo "JWT_SECRET_KEY=$(openssl rand -base64 32)" >> .env
50+
```
51+
52+
### 3. Start the Services
53+
54+
With the configuration in place, you can start all the services using Docker Compose.
55+
56+
```bash
57+
docker-compose up -d
58+
```
59+
60+
This command will download the necessary images, build the Forge application container, and start everything in the background (`-d`). The first time you run this, it may take a few minutes.
61+
62+
## Accessing Your Forge Instance
63+
64+
Once the startup is complete, you can access the services:
65+
66+
- **API Endpoint**: `http://localhost:8000`
67+
- **Interactive API Docs (Swagger UI)**: `http://localhost:8000/docs`
68+
69+
The database will be running on port `5432`, but it is only accessible to the other containers, not to your host machine by default.
70+
71+
## Basic Management
72+
73+
Here are the essential commands for managing your self-hosted instance:
74+
75+
- **View Logs**: See the real-time output from all services.
76+
```bash
77+
docker-compose logs -f
78+
```
79+
- **Restart Services**:
80+
```bash
81+
docker-compose restart
82+
```
83+
- **Stop Services**: Stop and remove the containers. Your database data will be preserved in a Docker volume.
84+
```bash
85+
docker-compose down
86+
```
87+
88+
## Managing Your Instance with the CLI
89+
90+
Once your Forge instance is running, you use the command-line interface (CLI) to create users and manage provider keys. To run the CLI, you execute commands inside the running `app` container.
91+
92+
The basic format is `docker-compose exec app python forge-cli.py [COMMAND]`.
93+
94+
### Create Your First User
95+
96+
This is the very first thing you should do. This command will create your admin user and generate your first Forge API key.
97+
98+
```bash
99+
docker-compose exec app python forge-cli.py register
100+
```
101+
102+
Follow the prompts to set your username, email, and password. **Save the Forge API key that is printed at the end.**
103+
104+
### Add a Provider Key
105+
106+
Next, add the API key for a provider like OpenAI or Anthropic.
107+
108+
```bash
109+
docker-compose exec app python forge-cli.py add-key
110+
```
111+
112+
This will launch an interactive prompt where you can select the provider and paste in your key.
113+
114+
### List Your Provider Keys
115+
116+
To see which providers you have successfully connected, run:
117+
118+
```bash
119+
docker-compose exec app python forge-cli.py list-keys
120+
```
121+
122+
### Explore All Commands
123+
124+
The Forge CLI has many other features. To see a full list of commands and options, use the `--help` flag:
125+
126+
```bash
127+
docker-compose exec app python forge-cli.py --help
128+
```

assets/i18n/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"SOLUTIONS": "Solutions",
5757
"EXPLORE": "Explore",
5858
"CONNECT": "Connect",
59+
"API_DOCS": "API Document",
5960
"FORGE": "Forge",
6061
"STUDIO": "Studio",
6162
"MCP_SERVER": "MCP Server (Coming Soon)",

assets/i18n/es.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"SOLUTIONS": "Soluciones",
5757
"EXPLORE": "Explorar",
5858
"CONNECT": "Conectar",
59+
"API_DOCS": "Documento de API",
5960
"FORGE": "Forge",
6061
"STUDIO": "Studio",
6162
"MCP_SERVER": "Servidor MCP (Próximamente)",

assets/i18n/ja.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"SOLUTIONS": "ソリューション",
5757
"EXPLORE": "探索",
5858
"CONNECT": "接続",
59+
"API_DOCS": "APIドキュメント",
5960
"FORGE": "Forge",
6061
"STUDIO": "Studio",
6162
"MCP_SERVER": "MCPサーバー (近日公開)",

assets/i18n/ko.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"SOLUTIONS": "솔루션",
5757
"EXPLORE": "탐색",
5858
"CONNECT": "연결",
59+
"API_DOCS": "API 문서",
5960
"FORGE": "Forge",
6061
"STUDIO": "Studio",
6162
"MCP_SERVER": "MCP 서버 (추후 오픈)",

0 commit comments

Comments
 (0)