tokenplace is a peer-to-peer generative AI platform that pairs those in need of LLM compute with individuals donating spare resources, aiming to democratize AI access.
The token.place API v1 launch contract for 0.1.0/0.1.x is frozen: API v1 is non-streaming, ciphertext-envelope-first for relay-blind E2EE paths, and is the active production API. API v2 is intentionally outside this launch contract.
OpenAI-compatible aliases are also registered at /v1/models, /v1/models/{model_id}, /v1/public-key, /v1/public-key/rotate, /v1/chat/completions, /v1/completions, /v1/images/generations, /v1/health, and /v1/relay/unregister.
Lists available API v1 models in OpenAI-compatible list format. API v1 returns stable OpenAI-style model objects, not the API v2 catalog schema.
Example Response:
{
"object": "list",
"data": [
{
"id": "llama-3.1-8b-instruct",
"object": "model",
"created": CREATED_UNIX_SECONDS,
"owned_by": "Meta",
"permission": [
{
"id": "modelperm-llama-3.1-8b-instruct",
"object": "model_permission",
"created": CREATED_UNIX_SECONDS,
"allow_create_engine": false,
"allow_sampling": true,
"allow_logprobs": true,
"allow_search_indices": false,
"allow_view": true,
"allow_fine_tuning": false,
"organization": "*",
"group": null,
"is_blocking": false
}
],
"root": "llama-3.1-8b-instruct",
"parent": null
}
]
}
Retrieves one API v1 model object by ID using the same OpenAI-compatible shape returned by the model list.
Retrieves the server public key used by encrypted API v1 request mode.
Example Response:
{
"public_key": "SERVER_PUBLIC_KEY_HERE"
}
Operator-gated. Rotates the server RSA key pair and returns the refreshed public key. Requires an operator token when operator auth is configured.
Creates a non-streaming chat completion. API v1 rejects stream: true. Encrypted mode sends ciphertext under messages and includes the client public key so only the client can decrypt the response.
Encrypted Request Body:
{
"model": "llama-3.1-8b-instruct",
"encrypted": true,
"client_public_key": "CLIENT_PUBLIC_KEY_HERE",
"messages": {
"ciphertext": "ENCRYPTED_MESSAGES_PAYLOAD_HERE",
"cipherkey": "ENCRYPTED_AES_KEY_HERE",
"iv": "INITIALIZATION_VECTOR_HERE"
}
}
Example Encrypted Response:
{
"encrypted": true,
"data": {
"encrypted": true,
"ciphertext": "ENCRYPTED_RESPONSE_PAYLOAD_HERE",
"cipherkey": "ENCRYPTED_AES_KEY_HERE",
"iv": "INITIALIZATION_VECTOR_HERE"
}
}
Creates a non-streaming legacy text completion response for OpenAI-compatible clients. API v1 rejects stream: true; relay-blind E2EE deployments should prefer encrypted /api/v1/chat/completions.
Generates a local placeholder image from a validated prompt and size. The response includes created, data[].b64_json, data[].revised_prompt, size, and optional seed.
Returns API health metadata: status, version, service, and a current timestamp.
Returns public-safe deployment metadata for the landing badge: environment, version, label, and optional short ref. It never exposes secrets or relay payload content.
Alias for the public release metadata payload, intended for simple deployment monitors and clients that only need a version check.
Lists community-operated relay and server providers as {"object":"list","data":[...]}, with optional metadata.
Returns the community model feedback leaderboard. An optional positive integer limit query parameter limits results.
Queues a community compute contribution offer and returns {"status":"queued","submission_id":"..."} with HTTP 202 when accepted.
Summarizes queued contribution offers for maintainers.
Lists the self-hosted relay provider registry as {"object":"list","data":[...]}, with optional metadata.
Returns configured relay server-node URLs for diagnostics and onboarding: configured_servers, primary, secondary, and total.
Operator-gated. Removes a registered compute node by server_public_key. This operator endpoint is distinct from compute-node self-unregister control-plane routes.
Selects the next registered API v1 compute node for encrypted relay work and returns its server_public_key.
Queues a ciphertext envelope for a selected compute node. Relay-owned state remains ciphertext-only plus safe routing metadata.
Ciphertext Envelope:
{
"server_public_key": "SERVER_PUBLIC_KEY_HERE",
"client_public_key": "CLIENT_PUBLIC_KEY_HERE",
"request_id": "REQUEST_ID_HERE",
"ciphertext": "ENCRYPTED_DATA_HERE",
"cipherkey": "ENCRYPTED_AES_KEY_HERE",
"iv": "INITIALIZATION_VECTOR_HERE"
}
Retrieves an encrypted response envelope by client_public_key and optional request_id. Returns {"status":"pending"} with HTTP 202 while queued work is still pending.
These API v1 routes are accounted for in the launch contract but are not general user-facing API endpoints. They are for registered compute nodes or internal relay lifecycle management and must stay ciphertext-only where payload envelopes are exchanged.
| Route | Purpose |
|---|---|
POST /api/v1/relay/servers/register | Compute node registration and heartbeat lease setup. |
POST /api/v1/relay/servers/unregister | Compute node self-unregister with relay registration authentication. |
POST /api/v1/relay/servers/poll | Compute node long-poll for the next encrypted workload envelope. |
POST /api/v1/relay/requests/cancel | Client request cancellation with a requester proof token. |
POST /api/v1/relay/responses | Compute node stores an encrypted response envelope for client retrieval. |
Internal fail-closed relay dispatch routes POST /relay/api/v1/chat/completions and POST /relay/api/v1/source intentionally reject plaintext distributed API v1 payloads.
API v1 relay traffic is mandatory end-to-end encrypted: relay endpoints are ciphertext-only and reject plaintext-like or unexpected top-level fields. Do not send plaintext top-level keys such as messages, prompt, input, content, response, or text to relay envelope routes.
Check out the roadmap section of the README.
We believe in the democratization of AI. Projects like Folding@Home inspired us to leverage peer-to-peer technology for generative AI, making sophisticated language models accessible to everyone.
Yes, thanks to our generous compute donors. We aim to keep it free, no strings attached, to ensure universal access to advanced AI.
You can contribute by donating compute resources or by participating in our community on GitHub. Every bit helps us grow and improve.
Learn more about our goals and how you can be a part of this initiative on our GitHub repository.
All communications are end-to-end encrypted by default and relay-mediated by design. Relay components must stay ciphertext-only (plus safe routing metadata). For maximum control, consider self-hosting via the README.