KeyoAPI

Build a study AI assistant with the chat API

A study AI assistant is most useful when it explains the learner's actual material and checks understanding. Use the chat API with a supplied course excerpt, ask for a short explanation or practice question, and verify the answer against the source before showing feedback.

Get API keyLive pricesModel guides

Ground explanations in course material

Select a relevant excerpt from notes or a textbook before calling the model. Give the excerpt an ID and ask the model to cite it in the answer. Tell it to say when the excerpt does not contain enough information. Your application must check cited IDs and answer claims; the prompt alone does not guarantee grounded output.

For longer materials, chunk and retrieve the relevant passages before constructing the request. PDF extraction is a separate step: the MinerU2.5-Pro model page documents an asynchronous parsing route. Do not assume a plain text chat request can directly read an uploaded PDF or browse a source URL. Preserve the original page reference so a student can open the source.

Example: explanation and a practice question

The example sends the course text directly in the message and asks for one short explanation and one quiz item. It uses gpt-6.1-sol on the OpenAI-compatible chat route. Treat the response as a draft that your application validates, especially for graded answers.

curl https://www.keyoapi.xyz/v1/chat/completions \
  -H "Authorization: Bearer $KEYO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-6.1-sol","messages":[{"role":"system","content":"Use only the supplied excerpt. Cite its ID. If it is insufficient, say so. Give a short explanation and one practice question with a separate answer."},{"role":"user","content":"Excerpt BIO-01: In photosynthesis, plants use light energy to convert carbon dioxide and water into sugars, releasing oxygen. Explain this to a beginner and ask one question about the inputs."}],"max_tokens":500}'

Create a learning loop rather than an answer dump

Keep the question, expected answer and supporting excerpt together. First show the question without its answer, collect the student's attempt, then give feedback and a hint. For factual quizzes, validate the answer key with the source or a teacher-authored reference before using it to grade.

Track the topics a learner has practiced and choose the next item from that history. Ask for a simpler explanation when the learner struggles, but keep the same source facts. Evaluate the system with missing excerpts, ambiguous questions and intentionally incorrect student answers, as well as easy examples. Measure whether feedback identifies the misconception without inventing a new fact.

Budget source context and repeated feedback

A 3,000-input and 600-output request costs about $0.0022062 at the checked Sol default-group rates. A lesson may use several requests for explanation, quiz generation and feedback. Sum actual usage across those steps and verify live rates on the pricing page; do not treat one request as the cost of the whole lesson.

Send only the relevant source excerpt and a compact learning summary. Compare candidate models using answer correctness, citation validity, helpful feedback and cost per reviewed lesson. GPT-6.1 Sol vs GPT-6 Astra covers one price comparison, while the model guides page links to individual API guides.

FAQ

Can a study AI read my textbook automatically?

This example reads text included in the request. Your application must extract and retrieve relevant textbook passages separately, using an appropriate document API if needed.

Does a source prompt prevent hallucinations?

No. It helps define the task, but your application still needs to check citations and facts against the source, especially before grading or publishing learning material.

Is this a ready-made student app?

This is an API integration guide. You build the student interface, retrieval, progress tracking and grading rules around the chat requests.

Related guides

the gpt-6.1-sol model page the MinerU2.5-Pro model page GPT-6.1 Sol vs GPT-6 Astra the model guides page the API endpoint reference