DEV Community

Cover image for From Curious to Confident: How I Use AI APIs Without Being a Machine Learning Expert
Shaw Sha
Shaw Sha

Posted on

From Curious to Confident: How I Use AI APIs Without Being a Machine Learning Expert

I remember staring at a research paper on transformer architectures back in 2020, feeling like I was trying to read ancient Greek. The math alone—attention mechanisms, positional encodings, multi-headed self-attention—made me wonder if I’d ever be able to build anything useful with AI.

Fast forward to today, and I’ve shipped three apps that use large language models under the hood. I still can’t explain the math behind a transformer. And honestly? I don’t need to.

You don’t need a PhD to build with AI. You need the right API key and about 10 lines of code. That’s it.

I say this as someone who comes from a frontend background. I’m comfortable with JavaScript, React, and Python for scripting, but I’ve never trained a model from scratch. I’ve never fine-tuned a neural network. But I’ve built chatbots, summarization tools, and even a simple code review assistant—all by treating AI APIs as black boxes that I can talk to.

Here’s how I went from curious to confident, and how you can too.

The Mental Shift That Changed Everything

The biggest barrier wasn’t technical—it was psychological. I kept thinking I needed to understand how AI worked before I could use it. That’s like thinking you need to understand combustion engines to drive a car.

Once I let go of that, things clicked.

I started treating AI APIs like any other third-party service—like Stripe for payments, or Twilio for SMS. I don’t know how those services work internally either. I just know the request format and the response shape.

The same logic applies here. You send text in, you get text out. The “AI” part is just a really smart function.

My First Real Project: A Meeting Notes Summarizer

Let me walk you through my first practical project. I wanted to take messy meeting transcriptions (think: “um, so, yeah, we need to, uh, finish the report”) and turn them into clean bullet-point summaries.

Here’s the code that made it happen. I used JavaScript with Node.js because that’s my comfort zone, but the same pattern works in Python, Go, or anything with HTTP support.

const API_URL = 'https://tai.shadie-oneapi.com/v1/chat/completions';
const API_KEY = process.env.AI_API_KEY;

async function summarizeMeeting(transcript) {
  const response = await fetch(API_URL, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': `Bearer ${API_KEY}`
    },
    body: JSON.stringify({
      model: 'gpt-3.5-turbo',
      messages: [
        {
          role: 'system',
          content: 'You are a meeting summarizer. Extract key decisions, action items, and open questions from the transcript. Format as bullet points.'
        },
        {
          role: 'user',
          content: `Please summarize this meeting transcript:\n\n${transcript}`
        }
      ],
      temperature: 0.3
    })
  });

  const data = await response.json();
  return data.choices[0].message.content;
}

// Usage
const messyTranscript = `So John said we need to launch by Q3... um, and Sarah mentioned the database migration... yeah, we're going with PostgreSQL...`;
summarizeMeeting(messyTranscript).then(summary => console.log(summary));
Enter fullscreen mode Exit fullscreen mode

That’s it. 25 lines of code, including whitespace and comments. The heavy lifting is done by the API—I’m just formatting the request and parsing the response.

I ran this for the first time and got back:

  • Key Decision: Launch by Q3
  • Action Item: Database migration to PostgreSQL (owner: Sarah)
  • Open Question: Need to confirm migration timeline

It wasn’t perfect, but it was shockingly good for a first attempt. That moment—when raw text turned into structured output—was when I went from curious to convinced.

The Three Things That Actually Matter

Through trial and error, I’ve distilled the “expertise” needed to work with AI APIs into three practical skills:

1. Prompt Engineering (Fancy Term, Simple Concept)

You don’t need to train models. You need to talk to them well.

The most important thing I learned: be specific about the format. If you want JSON back, say so. If you want bullet points, say so. If you want a certain tone, say so.

Bad prompt: “Summarize this.”
Good prompt: “Summarize this in three bullet points. Include one key decision, one action item, and one open question. Return as valid JSON with keys: decision, action, question.”

The difference is night and day.

2. Error Handling (Because APIs Fail)

AI APIs are not magical. They timeout. They return garbage. They get rate-limited.

I always wrap my calls in a try-catch and add a fallback response. Here’s a pattern I use:

async function safeAICall(prompt) {
  try {
    const result = await callAPI(prompt);
    return { success: true, data: result };
  } catch (error) {
    console.error('AI API failed:', error);
    return { success: false, data: 'I encountered an error. Please try again.' };
  }
}
Enter fullscreen mode Exit fullscreen mode

Simple, but it saved my app from crashing during a live demo once. Learn from my pain.

3. Cost Awareness (It’s Not Free)

Most AI APIs charge per token (roughly per word). I learned this the hard way when my first prototype sent entire Wikipedia articles as context and racked up a $15 bill in an afternoon.

Now I always:

  • Limit input length (trim long texts)
  • Set a max_tokens parameter (caps the output)
  • Use cheaper models for simple tasks (GPT-3.5 instead of GPT-4)

It’s not glamorous, but it keeps the project sustainable.

Why I Don’t Bother With Machine Learning

Every few months, someone asks me: “But don’t you want to understand how it works under the hood?”

I do, intellectually. But practically? No.

Building with AI APIs is like building a house. You don’t need to know how to forge nails or mill lumber. You need to know how to use a hammer and read a blueprint. The AI API providers have already done the hard work of training the models. My job is to integrate them into useful products.

This shift—from “I must understand everything” to “I just need to make it work”—unlocked so many projects for me. I’ve built:

  • A tool that generates unit tests from function signatures (saved me hours)
  • A Slack bot that answers questions about our internal docs
  • A content rewriter that adjusts tone for different audiences

Zero machine learning knowledge required. Just API calls and creative problem-solving.

The Practical Stack I Use Today

Over time, I’ve settled into a workflow that balances power, cost, and simplicity.

For quick prototypes, I use the OpenAI-compatible API format because it’s widely supported and well-documented. For production, I lean on services that offer consistent uptime and reasonable pricing.

And here’s where I’ll share something practical: I currently route my API calls through a unified endpoint at tai.shadie-oneapi.com. It gives me access to multiple models through a single API key, which is nice for testing different options without managing five different accounts. It’s not a sponsorship or anything—I just found it convenient and it’s been reliable for my side projects.

Your mileage may vary, and that’s fine. The key is to start. Pick an endpoint, copy the code snippet above, swap in your own prompt, and see what happens.

You Don’t Need to Be an Expert

I still can’t explain what a “transformer” is in mathematical terms. I don’t know what “QKV” stands for without Googling it. And I’ve never trained a model from scratch.

But I’ve built things that work, that people use, and that save time. That’s the real measure of confidence—not knowing everything, but knowing enough to ship.

The barrier to entry has never been lower. You have the curiosity (you’re reading this). You have the tools (the API and a few lines of code). Now you just need to take the first step.

Open your editor. Write that first function. Make the call.

You’ll be surprised at how far “just 10 lines of code” can take you.

Top comments (0)