Skip to content

OpenAI fine-tuning takes no new jobs from December 15, 2026. Move your fine-tunes

Batch and fine-tuning API

Agent quickstart

Point an AI agent at Gridline and let it fine-tune, evaluate and batch open models for you. There are no GPUs, containers or sandboxes to manage: the agent calls the same API you would.

Overview

Gridline's MCP server gives any MCP client (Claude Code, Claude Desktop and others) tools for the whole loop: upload data, fine-tune, evaluate the result against its base, batch on the winner and download the merged weights. Each tool wraps one OpenAI-compatible route under Gridline's base URL, so an agent without MCP can do the same over HTTP.

https://api.gridlinegpu.com/openai/v1

The OpenAPI 3.1 spec describes every documented route.

Getting access

  • Free credit: $5 for new accounts once the email is verified: one per email address (+tag variants count as one) and per network, while today's credits last.
  • Self-serve API keys: create one in the dashboard (https://gridlinegpu.com/dashboard/tokens), or let an agent sign up with POST https://gridlinegpu.com/api/agent/signup, which returns the key with no browser.

No account yet

An agent can create the account, its API key and the person's credit with no browser. First it shows the person the terms of use, the job terms and the privacy policy and gets their yes: it accepts them on the person's behalf.

curl -X POST https://gridlinegpu.com/api/agent/signup -H "Content-Type: application/json" \
  -d '{"email": "THE_PERSON_S_EMAIL", "accept_terms": true, "terms_of_use_sha256": "cd31d803738870acde75635d8941deb807388b66a273a179609e988bbc8bac4a"}'

The answer carries the API key once. The agent saves it to a private file and loads it as GRIDLINE_TOKEN. Before anything else (uploads, quotes, jobs) it verifies the email with the 6-digit code Gridline sends, subject "Your Gridline code": an agent that can read the person's inbox finds the newest one itself, using only an email from the sender GET https://gridlinegpu.com/api/agent names; otherwise the person opens their email and reads it the code. Then it opens the account once, before the first upload: it claims the free credit (one per email address, where +tag variants count as one, and per network, while it lasts), or asks for a card checkout link the person pays once (or a USDC payment request, when those are open). Until then uploads and jobs are refused. GET https://gridlinegpu.com/api/agent lists every step, body and current terms digest; each digest is the terms' version id, sent as given (it is not a hash of the .md file). For an existing account, or a key about to expire, the agent posts the email to /api/agent/login and the emailed code to /api/agent/login/verify for a new key.

Keys: POST /api/agent/key/revoke revokes the key the agent holds. Listing the keys or revoking another one needs an emailed code (/api/agent/keys/code, then /api/agent/keys/list and /api/agent/keys/revoke). Closing the account is not available to agents: the person does it in settings.

Connect an agent

With no browser, the server's signup tool creates an account and its key, and email_login gets a key for an existing account from an emailed code. The browser approval below is the fallback.

No key is needed up front. When a tool answers not_logged_in, the agent calls the server's login tool and shows you a link and a code: sign in (or sign up), check the code and click Approve. The server saves the key in a private file on your machine, the same one gridline login from the Python SDK uses. To use a key you already have, give it to the server as GRIDLINE_TOKEN. The key stays on your machine: the server sends it only to Gridline's API, never prints it and never returns it in a tool result.

Claude Code:

claude mcp add gridline -- npx -y @gridlinegpu/mcp

Any MCP client that reads a JSON config:

{
  "mcpServers": {
    "gridline": {
      "command": "npx",
      "args": ["-y", "@gridlinegpu/mcp"],
      "env": { "GRIDLINE_TOKEN": "<your Gridline API key>" }
    }
  }
}

The server runs over stdio as gridline-mcp. It also runs hosted at a URL, with nothing to install: see Remote MCP.

A worked loop

Ask the agent in plain language, for example:

Fine-tune qwen3.5-9b on ./train.jsonl. Then compare the fine-tuned model
with the base on ./eval.jsonl, and run ./requests.jsonl as a batch on whichever scores
higher. Tell me what each paid step will cost before you run it.

A capable agent then:

  1. Uploads train.jsonl with upload_file, purpose fine-tune.
  2. Quotes the job with create_fine_tune and dry_run, tells you the cost, and starts it once you agree, then polls get_fine_tune and list_fine_tune_events until it has an ft: model.
  3. Defines an eval with create_eval, quotes a run on the base and on the ft: model with create_eval_run and dry_run, and runs both once you agree.
  4. Compares the scores with get_eval_run and list_output_items.
  5. Uploads requests.jsonl (purpose batch), runs it on the better model with create_batch, and saves the results with download_results.

Spending credit

Four tools spend credit: create_fine_tune, create_eval_run and create_distillation (unless dry_run is true), and create_batch. Each refuses unless the call carries confirm_spend: true, so an agent cannot spend by accident: it has to read the quote or the price first, and a well-behaved agent tells you before it confirms. Every other tool is free. What each job costs is on the pricing page; fine-tunes are charged per training token, batches per input and output token, each with its minimum.

Tools

ToolSpends creditWhat it does
list_modelsNoBase models you can batch or fine-tune on, and your ft: models.
get_credit_balanceNoYour credit balance and recent charges.
upload_fileNoUpload a local JSONL file (purpose fine-tune or batch).
create_fine_tuneYesStart a LoRA, QLoRA or DPO fine-tuning job, or quote it with dry_run.
list_fine_tunesNoYour fine-tuning jobs.
get_fine_tuneNoA job's status, its quote and its ft: model once it succeeds.
list_fine_tune_eventsNoA job's progress and loss.
cancel_fine_tuneNoCancel a fine-tuning job.
create_batchYesRun a batch on a base model or your ft: model.
get_batchNoA batch's status, counts and output file ids.
cancel_batchNoCancel a batch.
download_resultsNoSave a batch's output or error file to a local path.
create_evalNoDefine an eval: its item schema and graders.
create_eval_runYesRun an eval, or quote it with dry_run.
get_eval_runNoA run's status and per-grader results.
list_output_itemsNoA run's graded rows.
create_distillationYesRun a one-call distillation job (teacher, student, prompt baking), or quote it with dry_run.
list_distillationsNoYour distillation jobs.
get_distillationNoA job's status, stage, costs and its ft: model once it succeeds.
list_distillation_eventsNoA job's stage events.
cancel_distillationNoCancel a distillation job and its current stage.
request_merged_weightsNoExport an ft: model merged into its base.
get_merged_weightsNoA merged-weights export's status and files.
get_merged_file_urlNoA short-lived download URL for one merged file.

Plain HTTP

An agent without MCP can run the same loop with any HTTP client, using a Gridline API key as the bearer token. The routes and objects are OpenAI's (see the quickstart).

# 1. Upload training data
curl https://api.gridlinegpu.com/openai/v1/files -H "Authorization: Bearer $GRIDLINE_TOKEN" \
  -F purpose=fine-tune -F file=@train.jsonl

# 2. Quote the fine-tune first (dry_run), then create it without dry_run (creating starts it)
curl https://api.gridlinegpu.com/openai/v1/fine_tuning/jobs -H "Authorization: Bearer $GRIDLINE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"model": "qwen3.5-9b", "training_file": "file-...", "method": "qlora", "dry_run": true}'

# 3. Quote an eval run first (dry_run), then run it without dry_run
curl https://api.gridlinegpu.com/openai/v1/evals/eval_.../runs -H "Authorization: Bearer $GRIDLINE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"data_source": {...}, "dry_run": true}'

# 4. Batch on the fine-tuned model
curl https://api.gridlinegpu.com/openai/v1/batches -H "Authorization: Bearer $GRIDLINE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"input_file_id": "file-...", "endpoint": "/v1/chat/completions", "completion_window": "24h"}'

Contact us

Building something, stuck on a job, or want to share feedback? A couple of lines is enough.

What's it about? (optional)

A person on our team reads every message and replies by email. Prefer to talk? Book a call