prod 0.1.1

Welcome to token.place!

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.


Try it out:


API

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.

Public/client API v1 launch contract

GET /api/v1/models

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
    }
  ]
}

GET /api/v1/models/{model_id}

Retrieves one API v1 model object by ID using the same OpenAI-compatible shape returned by the model list.

GET /api/v1/public-key

Retrieves the server public key used by encrypted API v1 request mode.

Example Response:

{
  "public_key": "SERVER_PUBLIC_KEY_HERE"
}

POST /api/v1/public-key/rotate

Operator-gated. Rotates the server RSA key pair and returns the refreshed public key. Requires an operator token when operator auth is configured.

POST /api/v1/chat/completions

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"
  }
}

POST /api/v1/completions

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.

POST /api/v1/images/generations

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.

GET /api/v1/health

Returns API health metadata: status, version, service, and a current timestamp.

GET /api/v1/meta

Returns public-safe deployment metadata for the landing badge: environment, version, label, and optional short ref. It never exposes secrets or relay payload content.

GET /api/v1/version

Alias for the public release metadata payload, intended for simple deployment monitors and clients that only need a version check.

GET /api/v1/community/providers

Lists community-operated relay and server providers as {"object":"list","data":[...]}, with optional metadata.

GET /api/v1/community/leaderboard

Returns the community model feedback leaderboard. An optional positive integer limit query parameter limits results.

POST /api/v1/community/contributions

Queues a community compute contribution offer and returns {"status":"queued","submission_id":"..."} with HTTP 202 when accepted.

GET /api/v1/community/contributions/summary

Summarizes queued contribution offers for maintainers.

GET /api/v1/server-providers

Lists the self-hosted relay provider registry as {"object":"list","data":[...]}, with optional metadata.

GET /api/v1/relay/server-nodes

Returns configured relay server-node URLs for diagnostics and onboarding: configured_servers, primary, secondary, and total.

POST /api/v1/relay/unregister

Operator-gated. Removes a registered compute node by server_public_key. This operator endpoint is distinct from compute-node self-unregister control-plane routes.

GET /api/v1/relay/servers/next

Selects the next registered API v1 compute node for encrypted relay work and returns its server_public_key.

POST /api/v1/relay/requests

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"
}

POST /api/v1/relay/responses/retrieve

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.

Internal relay control-plane routes

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.

RoutePurpose
POST /api/v1/relay/servers/registerCompute node registration and heartbeat lease setup.
POST /api/v1/relay/servers/unregisterCompute node self-unregister with relay registration authentication.
POST /api/v1/relay/servers/pollCompute node long-poll for the next encrypted workload envelope.
POST /api/v1/relay/requests/cancelClient request cancellation with a requester proof token.
POST /api/v1/relay/responsesCompute 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.

E2EE Usage and Relay Envelope

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.


Roadmap

Check out the roadmap section of the README.

FAQ

Why token.place?

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.

Is it really free?

Yes, thanks to our generous compute donors. We aim to keep it free, no strings attached, to ensure universal access to advanced AI.

How do I contribute?

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.

Privacy Notice

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.