Nosana API Documentation

website·Indexed 33 days ago

https://learn.nosana.com/

Technical documentation for the Nosana API version 1.0.0, featuring OpenAPI 3.1.0 specifications. Includes guides on agent authentication, per-second GPU market pricing billed via credits or NOS, and deployment capabilities.

Tokens
29.7K
Snippets
208
Records
244
Agent score
62%

What's inside Nosana

  1. Use the Nosana skill for GPU workload management

    The nosana skill allows developers to deploy and monitor GPU workloads on the Nosana network using the @nosana/kit. This skill is intended for tasks including creating, starting, monitoring, debugging, or tearing down Nosana deployments; writing and validating job definitions; selecting GPU markets; accessing deployed service endpoints; reading deployment logs; and managing credits, vaults, and API errors.
    {
      "name": "nosana",
      "description": "Deploy and monitor GPU workloads on the Nosana network with @nosana/kit...",
      "type": "skill-md",
      "url": "https://raw.githubusercontent.com/nosana-ci/nosana-kit/3d117eb08656ed87f4dd24a04d0a88a5d7d7c56e/packages/skills/skills/nosana/SKILL.md",
      "source": "https://github.com/nosana-ci/nosana-kit/tree/main/packages/skills/skills/nosana"
    }
  2. Get node market relations

    Retrieve information about node market relations. This endpoint accepts an optional market query parameter.
    curl -X GET "https://api.nosana.com/nodes/market-relation?market=YOUR_MARKET"
  3. Check credit invitation status

    Retrieve details about a specific credit invitation using its token. This allows checking the credit amount, expiration date, whether it has been claimed, and any restrictions on the associated email or account name.
    curl -X GET "https://api.nosana.com/credits/invitations/{token}"
  4. Retrieve node metrics and hardware status

    Fetch performance metrics and hardware specifications for a specific node. The response includes the node's status (REJECTED, ONBOARDED, or PREMIUM), GPU details (UUID, VRAM, architecture), and associated market addresses. You can optionally filter the returned metrics using the metrics query parameter.
    GET /nodes/{id}/metrics?metrics=cpu,memory
    Authorization: <token>
  5. Understand Nosana GPU billing and pricing model

    Nosana uses a per-second billing model based on the specific GPU market deployed to. A market consists of a specific GPU model within a specific tier.

    Key billing rules:

    • Billing Interval: Per second, from job start to stop.
    • Scaling: Billed per replica (e.g., 3 replicas cost 3x the single GPU price).
    • Resource Allocation: Billed by market; the user holds the entire GPU regardless of internal usage.
    • Spend Caps: The deployment timeout (defined in minutes) acts as a maximum lifetime cap on spend. Credit-funded deployments require a minimum timeout of 60 minutes.
  6. Administer LLM models in Client Manager

    The /credits/admin/llm/models endpoints allow administrators to manage LLM models. You can retrieve a list of models or create a new model configuration. Creating a model requires specific details about the template, source commit, and pricing.
    # List LLM models
    GET /credits/admin/llm/models
    
    # Create an LLM model
    POST /credits/admin/llm/models
    
    # Partially update an LLM model
    PATCH /credits/admin/llm/models/{id}
  7. Get a specific deployment by ID

    Retrieve detailed information about a single deployment using its public key.
    GET /deployments/{deployment}
    x-user-id: <user_id>
    authorization: <signed_message>
  8. Revoke Nosana credentials

    Credentials can be invalidated as follows:

    • API Keys: Delete or deactivate the key in the Nosana dashboard.
    • OAuth Tokens: POST to the revocation_endpoint found in the OIDC metadata, or use the end_session_endpoint. Always discard the associated refresh token upon revocation.
  9. Configure a new LLM model

    To create an LLM model via POST /credits/admin/llm/models, provide a JSON body with the following requirements:

    • templateId: Minimum 1 character.
    • sourceCommit: Must be a 40-character hex string (regex: ^[a-f0-9]{40}$).
    • market: String between 32 and 64 characters.
    • replicas: Integer between 1 and 10.
    • pricing: Object containing prompt and completion costs as numeric strings.
    {
      "templateId": "my-template",
      "sourceCommit": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0",
      "market": "market-address-string-32-to-64-chars",
      "replicas": 2,
      "maxHourlyUsd": 10.5,
      "pricing": {
        "prompt": "0.001",
        "completion": "0.002"
      }
    }
  10. Define S3 storage targets in JobDefinition

    When defining a JobDefinition, S3 storage targets can be configured in three different formats depending on the requirement: a single file/URL, a specific bucket, or multiple buckets. All S3 configurations require type set to S3, a target identifier, and an IAM object containing REGION, ACCESS_KEY_ID, and SECRET_ACCESS_KEY.
    // Option 1: Single target/URL
    {
      "type": "S3",
      "target": "my-target",
      "url": "https://...",
      "allowWrite": true,
      "files": ["file1.txt"],
      "IAM": { "REGION": "us-east-1", "ACCESS_KEY_ID": "...", "SECRET_ACCESS_KEY": "..." }
    }
    
    // Option 2: Specific bucket
    {
      "type": "S3",
      "target": "my-target",
      "bucket": "my-bucket-name",
      "IAM": { "REGION": "us-east-1", "ACCESS_KEY_ID": "...", "SECRET_ACCESS_KEY": "..." }
    }
    
    // Option 3: Multiple buckets
    {
      "type": "S3",
      "target": "my-target",
      "buckets": [
        { "url": "https://...", "files": ["a.txt"] },
        { "url": "https://...", "files": ["b.txt"] }
      ],
      "IAM": { "REGION": "us-east-1", "ACCESS_KEY_ID": "...", "SECRET_ACCESS_KEY": "..." }
    }
  11. Use the Nosana agent skill for TypeScript SDK automation

    The Nosana agent skill provides procedural knowledge for using the @nosana/kit TypeScript SDK. It covers tasks such as creating and starting deployments, selecting a GPU market, monitoring endpoints, reading logs, and managing credits and errors.
    Skill URL: https://raw.githubusercontent.com/nosana-ci/nosana-kit/3d117eb08656ed87f4dd24a04d0a88a5d7d7c56e/packages/skills/skills/nosana/SKILL.md
  12. Job Definition Global Settings

    Global settings for a job definition control the runtime environment, including GPU requirements, entrypoints, and environment variables.
    {
      "global": {
        "image": "string",
        "gpu": boolean,
        "entrypoint": ["string"],
        "env": {
          "KEY": "VALUE"
        },
        "work_dir": "string",
        "variables": {
          "VAR_NAME": "VALUE"
        }
      }
    }