Skip to main content
nimble-code answers questions about the quality of one unit of code, e.g., a function, a file or a diff. It takes the same three types of question as nimble-latest, which are noul, choice and score. Send the request to POST /v1/systemone with the model nimble-code:
  • Put the unit of code in state, as a JSON object. Describe the code lists its fields.
  • Add your questions about the code. The question IDs are your own, and the answers use the same IDs.

Make a request

Read the answer

  • The noul of hides_errors is the probability that the function hides errors from its caller.
  • The choice of main_problem is the option with the highest probability. probabilities gives every option, and they add up to 1.
  • The score of error_handling is the expected level, counting from 0. Here the most likely level is 0, and the expected level is 0.512.
  • confidence is 1 when one option has all the probability, and 0 when every option is equally likely. It is not the chance that the answer is right.
  • usage.input_tokens is the number of input tokens that you pay for. Pricing explains how Nimble counts them.

Describe the code

Send one unit of code in each request. The state is a JSON object with these fields: Nimble reads the state as JSON text. A state can also be a string, or another JSON object or list, but nimble-code was trained on states with these fields. Each question gets its own prompt, with the whole state in it. So a question’s answer does not depend on the other questions in the request, or on the question’s ID. The option keys of a choice question are part of its prompt, so renaming an option can change the answer.

Limits

  • Nimble never cuts a prompt. A request gets 422 if the prompt for any of its questions is longer than 8,192 tokens.
  • When nimble-code is busy, a request gets 529. Retry it after about one second, with backoff.
The limits page lists the limits that apply to every model.