{"openapi":"3.1.0","info":{"title":"GPA API","version":"1.0.0","description":"Calculate a weighted grade-point average (GPA). The calc endpoint takes a list of courses — each with a grade and the credit hours it is worth — and returns the credit-weighted GPA, the totals, and a per-course breakdown of quality points so you can see exactly how the average was formed. Grades may be US letter grades (A, A-, B+, … F) on the standard 4.0 scale, or 4.3 with the us_plus scale that gives A+ extra weight; percentages from 0 to 100 mapped to letters and points with the usual cutoffs; raw grade points given directly as numbers; or your own custom letter-to-point mapping for any institution's scheme. Courses can be passed as a JSON array or a compact string like \"A:3,B+:4,C:2\", and credits default to 1 for an unweighted average. The scales endpoint lists the built-in grade scales and their point values. Everything is computed locally and deterministically, so it is instant and private — no student data is stored. Ideal for student planners and dashboards, university and school portals, LMS and ed-tech apps, scholarship and admissions tools, and academic what-if calculators. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This computes GPA; for general statistics use a statistics API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/gpa-api","description":"oanor gateway"}],"tags":[{"name":"GPA"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/calc":{"get":{"operationId":"get_v1_calc","tags":["GPA"],"summary":"Calculate GPA","description":"","parameters":[{"name":"courses","in":"query","required":true,"description":"JSON array of {grade,credits} or a string like 'A:3,B+:4,C:2'","schema":{"type":"string"},"example":"A:3,B+:4,C:2"},{"name":"scale","in":"query","required":false,"description":"us (default, 4.0), us_plus (4.3) or percentage","schema":{"type":"string"},"example":"us"},{"name":"scale_map","in":"query","required":false,"description":"Optional custom letter→point JSON map","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"gpa":3.24,"scale":"us","courses":3,"breakdown":[{"grade":"A","letter":"A","points":4,"credits":3,"quality_points":12},{"grade":"B+","letter":"B+","points":3.3,"credits":4,"quality_points":13.2},{"grade":"C","letter":"C","points":2,"credits":2,"quality_points":4}],"gpa_precise":3.2444,"total_credits":9,"total_quality_points":29.2},"meta":{"timestamp":"2026-06-03T17:42:19.918Z","request_id":"ff88f8b1-d93f-448c-a2f6-31588b8cf122"},"status":"ok","message":"Calculate GPA","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/scales":{"get":{"operationId":"get_v1_scales","tags":["GPA"],"summary":"List grade scales","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"scales":{"us":{"A":4,"B":3,"C":2,"D":1,"F":0,"A+":4,"A-":3.7,"B+":3.3,"B-":2.7,"C+":2.3,"C-":1.7,"D+":1.3,"D-":0.7},"us_plus":{"A":4,"B":3,"C":2,"D":1,"F":0,"A+":4.3,"A-":3.7,"B+":3.3,"B-":2.7,"C+":2.3,"C-":1.7,"D+":1.3,"D-":0.7},"percentage":"0–100 mapped to US letters (93+=A, 90+=A-, 87+=B+, …, <60=F)"}},"meta":{"timestamp":"2026-06-03T17:42:20.024Z","request_id":"def61567-281a-4253-95a6-30ba3b300b34"},"status":"ok","message":"List grade scales","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Spec","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"name":"GPA API","notes":"GPA = Σ(grade points × credits) ÷ Σ(credits). Credits default to 1 when omitted (unweighted). Percentages use the common US cutoffs (93+ = A, 90–92 = A-, …). This computes GPA — for general statistics use a statistics API. Nothing is stored.","version":"v1","endpoints":[{"path":"/v1/calc","params":{"scale":"us (default, 4.0), us_plus (4.3) or percentage","courses":"a JSON array of {grade, credits} — or a string like 'A:3,B+:4,C:2'","scale_map":"optional custom letter→point JSON map"},"returns":"the weighted GPA, totals and per-course breakdown"},{"path":"/v1/scales","params":[],"returns":"the built-in grade scales and their points"},{"path":"/v1/meta","params":[],"returns":"this document"}],"description":"Calculate a weighted grade-point average (GPA). The calc endpoint takes a list of courses — each with a grade and the credit hours it is worth — and returns the credit-weighted GPA, the totals and a per-course breakdown of quality points. Grades may be US letter grades (A, A-, B+ … F) on the standard 4.0 scale (or 4.3 with us_plus), percentages 0–100 mapped to letters and points, raw grade points given directly as numbers, or your own custom letter→point mapping. The scales endpoint lists the built-in grade scales. Pure local maths, no key."},"meta":{"timestamp":"2026-06-03T17:42:20.155Z","request_id":"4e501dd5-e1eb-4f77-b17f-5b5ac21071d4"},"status":"ok","message":"Meta","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":4735,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":625,"monthly_call_quota":14250,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2615,"monthly_call_quota":193500,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":6415,"monthly_call_quota":1010000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/gpa-api"}