Spin-Up API Documentation

Spin-Up provides hosted Docker containers on isolated EC2 instances, accessible via a secure API key. Use this API to generate text with models like llama3.2:1b.

Base URL

https://SUBDOMAIN.spin-up.ai/api/generate

The SUBDOMAIN is a unique auto assigned identifier e.g. ke35xrs4

Your request is unique per instance

https://ke35xrs4.spin-up.ai/api/generate

Authentication

All requests require an API key in the header:

X-Api-Key: YOUR_API_KEY_HERE

Request Format

Parameter Type Description
model string Model to use, e.g., "llama3.2:1b"
prompt string Text prompt to generate completions for
stream boolean true for streamed responses, false for full response

cURL Example (Windows CMD)

curl -X POST "https://ke35xrs4.spin-up.ai/api/generate" ^
-H "Content-Type: application/json" ^
-H "X-Api-Key: 94d23bc5-892a-42dc-a2e9-2b94613ab1f2" ^
-d "{""model"": ""llama3.2:1b"", ""prompt"": ""Why is the sky blue?"", ""stream"": false}"
  
Notes: Use ^ to continue lines in Windows CMD. Double quotes inside JSON are escaped with "".

JavaScript Example (Node.js / Browser)

const response = await fetch("https://ke35xrs4.spin-up.ai/api/generate", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-Api-Key": "94d23bc5-892a-42dc-a2e9-2b94613ab1f2"
  },
  body: JSON.stringify({
    model: "llama3.2:1b",
    prompt: "Why is the sky blue?",
    stream: false
  })
});

const data = await response.json();
console.log(data);
  

Response

{
  "id": "abc123",
  "model": "llama3.2:1b",
  "output": "The sky appears blue due to Rayleigh scattering...",
  "usage": {
    "tokens": 45
  }
}
  

Tips for Developers


How to Format Your CSV File for AI Model Training

Our AI training service allows you to upload a dataset in CSV format to fine-tune a language model. Follow this guide to make sure your CSV file is properly formatted for training and hosting.


1. Basic Requirements

  • The file must be UTF-8 encoded.
  • Include a header row (column names).
  • Must have at least two columns: one for the text and one for the label.
Example header:
text,label

2. Example for Text Classification

textlabel
I love this product!positive
This is the worst purchase I’ve ever made.negative
The quality is okay, not great.neutral

Note: The text column contains your input sentences, and the label column contains your target categories.

3. Multiple Labels (Multi-Class Classification)

If your model predicts one of several categories, use a single label column:

text,label
This movie was great!,positive
I didn’t like the plot.,negative
It was okay,neutral

4. Multiple Tags (Multi-Label Classification)

If each text can have several labels, separate them with commas:

text,labels
This article talks about space and technology,science,technology
I love cooking Italian food,food,italy

Our system automatically detects multiple labels when comma-separated.

5. Optional Columns

You can include additional optional columns for metadata (these will be ignored during training):

textlabelsourcelanguage
I’m happy today positive Twitter en

6. Formatting Tips

  • Remove empty rows.
  • Avoid unquoted commas inside text fields (e.g., use "I love, really love, pizza").
  • Ensure consistent label naming (avoid mixing Positive, positive, etc.).
  • Save as .csv (not .xls or .xlsx).

7. File Size and Limits

Depending on your plan:

  • Maximum file size: 50 MB
  • Maximum rows: 100 000 rows

(Replace these with your actual platform limits.)

8. Validation Checklist

  • Header row present
  • Contains text and label columns
  • UTF-8 encoded
  • No missing or duplicate labels
  • File saved as .csv
Once your file passes validation, upload it directly to our platform. Our system will automatically detect columns, preprocess your data, train the model, and host it via API.