🎮 GPU API Reference

Base URL: https://dcdncloud.com/api/v1/gpu

All endpoints require Authorization: Bearer YOUR_TOKEN unless noted.

Quick Reference

Inference

MethodEndpointDescription
POST/inferenceRun inference (completion)
POST/inference/streamStreaming inference (SSE)
POST/inference/batchBatch inference (multiple prompts)
POST/inference/billedBilled inference (token-metered)

Models

MethodEndpointDescription
GET/modelsList all available models
GET/models/{model_id}Get model details
GET/models/{model_id}/providersList providers for a model
GET/agent/modelsModels available for agents

Nodes

MethodEndpointDescription
GET/nodesList GPU nodes
GET/nodes/{node_id}Node details + hardware specs
GET/nodes/{node_id}/monitoringLive GPU/CPU/RAM metrics
GET/statsMarketplace-wide statistics

Training (Fine-tune)

MethodEndpointDescription
POST/training/createCreate training job
GET/training/jobsList training jobs
GET/training/jobs/{id}Get job details
DELETE/training/jobs/{id}Cancel training job

GPU Rentals

MethodEndpointDescription
POST/rentRent a GPU node
GET/rentalsList active rentals
DELETE/rentals/{id}Cancel rental

Inference Endpoints

POST /inference

Run a single completion. OpenAI-compatible format.

curl -X POST https://dcdncloud.com/api/v1/gpu/inference \
  -H "Authorization: Bearer TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "dcdn-smart",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "What is DCDN Cloud?"}
    ],
    "max_tokens": 500,
    "temperature": 0.7
  }'

Response:

{
  "id": "inf-abc123",
  "model": "dcdn-smart",
  "choices": [{
    "message": {"role": "assistant", "content": "DCDN Cloud is a..."},
    "finish_reason": "stop"
  }],
  "usage": {"prompt_tokens": 25, "completion_tokens": 150, "total_tokens": 175}
}
POST /inference/stream

Streaming inference via Server-Sent Events (SSE).

curl -X POST https://dcdncloud.com/api/v1/gpu/inference/stream \
  -H "Authorization: Bearer TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "dcdn-fast",
    "messages": [{"role": "user", "content": "Write a haiku"}],
    "stream": true
  }'

Response is a stream of data: {...} SSE events, terminated by data: [DONE].

POST /inference/batch

Send multiple prompts in one request.

curl -X POST https://dcdncloud.com/api/v1/gpu/inference/batch \
  -H "Authorization: Bearer TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "dcdn-smart",
    "prompts": ["Translate: Hello", "Summarize: quantum computing"],
    "max_tokens": 200
  }'

Model Endpoints

GET /models

List all available models with pricing.

curl https://dcdncloud.com/api/v1/gpu/models \
  -H "Authorization: Bearer TOKEN"

Response includes: model name, provider, context window, input/output pricing per 1M tokens.

GET /stats

Marketplace statistics: total nodes, models, inferences, avg latency, revenue.

curl https://dcdncloud.com/api/v1/gpu/stats \
  -H "Authorization: Bearer TOKEN"

Training Endpoints

POST /training/create

Create a new fine-tuning job.

{
  "model": "meta-llama/Llama-3-8B",
  "dataset_url": "https://example.com/train.jsonl",
  "epochs": 3,
  "learning_rate": 2e-5,
  "batch_size": 4
}
GET /training/jobs

List all your training jobs with status, progress, and metrics.

DELETE /training/jobs/{job_id}

Cancel a running or queued training job.

Rental Endpoints

POST /rent

Rent a GPU node by the hour.

{
  "node_id": "DCDN-SA-c47e",
  "hours": 4
}

Price is set by the node operator. Revenue split: 70% operator / 25% platform / 5% treasury.

GET /rentals

List your active GPU rentals with time remaining and billing info.

DELETE /rentals/{rental_id}

Cancel an active rental. Unused time may be refunded per the cancellation policy.

OpenAI-Compatible Route

For full OpenAI SDK compatibility, use the /v1/chat/completions endpoint:

curl https://dcdncloud.com/v1/chat/completions \
  -H "Authorization: Bearer TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "dcdn-smart",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

This route is also available at /api/v1/openai/v1/chat/completions.

Authentication

All requests require a Bearer token from the DCDN Cloud dashboard. Alternatively, AI agents can use x402 payments (USDC on Base) for per-request access without an API key.

Related Docs