40% off everything — use code SAVE40 at checkout · ends in …
Skip to content
phpguru.store
Ages 18+ Intermediate

AI for PHP Developers: Claude, OpenAI and Gemini APIs in Real Apps

Add real AI features to your PHP apps — safely, cheaply, and with any provider.

Claude, OpenAI and Gemini behind one PHP interface: reliable JSON, summaries and reply drafts, streaming, semantic search and answers from your own documents.

  • 12 lessons
  • Intermediate
  • Claude · OpenAI · Gemini
  • Plain PHP + cURL
  • One-time payment

Last updated 9/2026 English Read online + Word file Created by phpguru.store

What you'll learn

  • Call the Claude, OpenAI and Gemini APIs from plain PHP with cURL, and hide them behind one interface so the provider is a config setting
  • Keep API keys out of code and browsers, cap spend per request and per day, and log tokens and cost for every call
  • Write prompts as versioned templates that separate your instructions from user data
  • Get structured JSON back, validate it, and handle the times the model gets it wrong
  • Ship summaries, reply drafts and data extraction with a human approving every change
  • Stream answers to the browser, and run slow AI work in a background job with retries
  • Build semantic search with embeddings stored in MySQL, and a documentation assistant that answers only from your own content and cites it
  • Defend against prompt injection, escape model output, protect personal data, and rate-limit AI endpoints
₹1,499$39

One-time payment · 12 lessons · Read online + Word file

Read lesson 1 free

Secured by Razorpay · we never see your card/UPI details

Most AI tutorials stop at a chat box. This course starts where your job starts: an existing PHP application that needs useful AI features without leaking keys, burning money, or trusting output it shouldn't. Twelve lessons take one project — a small support desk with tickets, customers and a knowledge base — and add summaries, reply drafts, data extraction, streaming answers, semantic search and a documentation assistant that cites its sources.

You write a provider-neutral client in plain PHP and cURL for Anthropic's Claude, OpenAI and Google Gemini, so switching models is a config change. Every feature keeps a human in the loop, validates what the model returns, escapes it before display, and logs tokens and cost. Read online with progress saved, and keep the whole course as a Word document.

Is this you?

  • AI demos look easy, but you don't know how to add AI to a real PHP app.
  • You worry about leaked API keys, runaway bills and prompt injection.
  • The model sometimes returns broken JSON and your code falls over.
  • You'd like search and answers from your own content, not just a chat box.

This course is written to take you from exactly that point to a result you can see.

What you'll build

AI features inside a real PHP support desk

  • One client for Claude, OpenAI and Gemini
  • Keys out of code, spend caps and cost logging
  • Validated JSON output
  • Ticket summaries and reply drafts with human approval
  • Data extraction from messy text
  • Streaming answers to the browser
  • Semantic search with embeddings in MySQL
  • A document assistant that cites its sources

Before and after this course

Before

  • “I've only used AI in a chat window.”
  • “I fear keys leaking and bills exploding.”
  • “I can't trust what the model returns.”

After

  • “I ship AI features in my PHP apps.”
  • “Keys, costs and abuse are under control.”
  • “I validate and handle every model response.”

Why learn it this way

  1. Read
  2. Code
  3. Test
  4. Build
  5. Deploy

You build everything with plain PHP and cURL, so it runs on the hosting you already have — and switching provider is a config change.

Judge it yourself before you pay

  • Lesson 1 is free, in full. Read it and try the code — that is exactly the quality of every other lesson. Read it now →
  • The full curriculum is on this page. All 12 lessons, with what each covers — you know what you're buying.
  • Written by the team that builds the PHP systems sold on this site — the same PHP 8, PDO and security practices our own management systems ship with.
  • Secure checkout by Razorpay, instant access, and email support if a lesson doesn't make sense.

Before you start

  • You can build a PHP app with PDO, forms and sessions — the Foundations and Practice courses, or equivalent
  • PHP 8.1+ with the cURL extension, and a MySQL/MariaDB database
  • An API key from at least one of Anthropic, OpenAI or Google AI Studio (each has a pay-as-you-go plan; a few dollars covers every exercise)

Curriculum

Lesson 1 is free to read, no account needed. The rest unlock the moment you buy.

  1. 1 What an AI API really is (and your first call from PHP) Preview free A language model API is an HTTPS endpoint that takes text and returns text. What that means for latency, cost and reliability, where it belongs in a PHP app, and a first working call to Claude with nothing but cURL. 4 min
  2. 2 One client, three providers A small PHP interface with Claude, OpenAI and Gemini implementations over plain cURL — timeouts, error types, retries on overload — so the rest of your app never knows which company answered. 4 min
  3. 3 Keys, configuration and cost control Where API keys live and where they must never appear, a usage log with the cost of every call, per-request and per-day spending caps, and caching so the same question isn't paid for twice. 4 min
  4. 4 Prompts that survive production System prompts as versioned templates, a hard wall between your instructions and user data, examples that fix the format, temperature, and how to test a prompt change before it ships. 3 min
  5. 5 Structured output — JSON you can trust Ask for JSON, get JSON, and never assume it: extracting it from the reply, validating every field in PHP, one repair attempt, and what to do when the model still gets it wrong. 3 min
  6. 6 Feature — ticket summaries and reply drafts The first two user-facing features: a "Summarise" button and a "Draft reply" an agent edits before sending — the endpoint, the fetch call, loading and error states, and why the human always presses Send. 3 min
  7. 7 Feature — extracting data from messy text Turn a pasted email, invoice or enquiry into form fields: a strict schema, normalising dates and money in PHP, marking what the model was unsure of, and a review screen before anything is saved. 3 min
  8. 8 Streaming answers to the browser Show the answer word by word instead of after a 15-second wait — server-sent events from the provider, a cURL write callback that forwards them, output buffering traps on shared hosting, and a small JavaScript reader. 3 min
  9. 9 Semantic search with embeddings in MySQL Search the knowledge base by meaning, not exact words — what an embedding is, generating and storing vectors in MySQL, cosine similarity in PHP, keeping them fresh, and when you need a real vector database. 3 min
  10. 10 Answers from your own documents (RAG) A help assistant that answers only from your knowledge base and cites the articles it used — chunking, retrieval, a prompt that forbids guessing, checking the citations, and saying "I don't know" gracefully. 3 min
  11. 11 Security — prompt injection, output handling and privacy The threats that are new with AI and the ones that are old ones in disguise — prompt injection, model output as untrusted input, leaking private data into prompts, abuse and cost attacks — with the PHP defences for each. 5 min
  12. 12 Shipping — background jobs, tests, monitoring and next steps Move slow AI work off the request with a MySQL job queue and retries, test features without calling a model, watch cost and quality after launch, and a production checklist — then where to take it next. 4 min

How it works

  1. 1 · Buy once

    One payment in your own currency, no subscription. Your account is created from the email you pay with.

  2. 2 · Log in and read

    Every lesson opens in your account on any device. Mark each one done and pick up where you left off.

  3. 3 · Keep the Word file

    The whole course as a .docx — annotate it, print it, read it offline. Re-download it any time from your orders.

Where this course fits

  1. PHP Foundations
  2. AI for PHP Developers · you are here
  3. Agentic AI Course

Questions about this course

Which AI provider do I need?

Any one of Anthropic, OpenAI or Google. The course builds a single interface so you can use or switch between all three.

Is this a video course?

No — it's written to be read. Every lesson is built around code you type and run yourself, with exercises at the end, and takes about 4 minutes to read. Code is text; reading it lets you copy, search and re-read the exact line you're stuck on.

What exactly do I get?

Two things: the lessons online in your account (with your progress saved), and the same content as one Word document (.docx) you download and keep. Both are delivered instantly after payment.

Do I need an account?

It's made for you at checkout from the email you pay with — you log in with a one-time code sent to that email (or Google), no password to remember.

Which PHP version is this written for?

PHP 8, using PDO prepared statements, password hashing and the practices our own management systems ship with — not the decade-old mysql_* code most free tutorials still carry.

Can I get a refund?

Like our software, courses are delivered instantly and are non-refundable — which is why lesson 1 is free to read and the full curriculum is listed above before you buy. See the refund policy.

₹899$23.40
₹1,499$39
40% off

Code SAVE40 applied at checkout · ends in …

One-time payment · Read online + Word file · No subscription · Billed in USD, international cards accepted

Read lesson 1 free

Secured by Razorpay. We never see your card/UPI details.

  • 12 lessons, about 42 minutes of reading
  • Read online in your account, on any device
  • Progress saved lesson by lesson
  • The whole course as a Word (.docx) file
  • Printable certificate of completion when you finish
  • Access doesn't expire — no subscription
  • Written for PHP 8 — no mysql_* era code
  • Email support if a lesson doesn't make sense

What happens after you pay

  1. 1. The Word file link appears on-screen and is emailed to you
  2. 2. Log in with the same email (one-time code, no password) and every lesson is open
  3. 3. Read at your own pace — mark lessons done as you go

Courses are delivered instantly and are non-refundable — which is why the first lesson is free to read before you decide.