This course is for people building things with AI models, but it doesn't assume you've done that before. This lesson covers the handful of ideas from programming that the rest leans on.
An API (application programming interface) is a way for one program to use another over the network. Your program sends a request, a message saying what it wants, and gets back a response. AI companies offer their models through APIs: you send text in a request, the model's reply comes back in the response, and you're billed for what you used. An API key is a secret password that identifies your account on each request, so it must never be shared or put in public code.
Requests and responses are usually written in JSON, a plain-text format for data. Curly brackets hold an object: named fields, each "name": value. Square brackets hold a list. A value can be text in double quotes, a number, true or false, or null, which means "no value".
The examples that compute something are short Python, a popular programming language. You only need to read them. x = 5 stores a value under a name. print() shows a result, which appears under the code. [1, 2] is a list and {"a": 1} a dictionary, Python's version of a JSON object, read with d["a"]. def name(x): defines a function, a named set of steps, and import json loads Python's ready-made JSON tools, so json.loads() turns JSON text into a dictionary.
import json
order = json.loads('{"id": "A-1042", "paid": true}')
print(order["id"], order["paid"])
Prints
A-1042 True
Finally, "the cloud" means renting computers and ready-made services from a company like Amazon (AWS), Microsoft (Azure) or Google over the internet, instead of running your own. A model is the trained AI itself; a provider is the company that runs it for you.
Practice
What is an API?
More info
Quick reference
API
How one program asks another for something: a request, then a response.
API key
A secret that identifies your account on each request.
JSON
Text data: {objects}, [lists], "text", numbers, true, false, null.
x = 5, print(x)
Store a value; show it.
dict, d["k"]
Python's version of a JSON object, and reading a field.
json.loads(s)
Turn JSON text into Python data.
The cloud
Rented computers and services, reached over the internet.