Skip to main content

client.generate()

Send a prompt to the decentralized network to receive an AI-generated completion.

Usage

response = client.generate(
    prompt="Explain quantum tunneling",
    max_tokens=256,
    temperature=0.7
)

Arguments

ArgumentTypeDefaultDescription
promptstrRequiredInput text prompt
max_tokensint256Max tokens returned
temperaturefloat0.7Sampling randomness

Response Structure

Returns a dictionary with the following fields:
{
  "id": "job_abc123",
  "node": "node-9006",
  "usage": {
      "tokens": 142,
      "credits_deducted": 1.42
  },
  "output": "Quantum tunneling occurs when..."
}