API Documentation
Everything to connect legal intelligence to its application: from the first call to consumer monitoring, with examples in six languages.
https://app.jusneural.com/api/api-jusneural/consultarhttps://app.jusneural.com/api/api-jusneural/solicitacoesEntry: R$ 31,38 / 1M tokens · Output: R$ 120,29 / 1M tokens · Minimum charging: R$ 300,00
JSON Response · Bearer Authentication · Customer Timeout: 120 seconds
Start here.
The Jusneural 2.0 Pro API receives a question or document and delivers a textual answer to JSON. Use is independent of platform plans: anyone registered can create a key and reload the API wallet.
- Create a key in the panel and store it on an environment variable on your server.
- Add credits to the API portfolio. Minimum charge is R$ 300.00.
- Choose language and operation in the sample generator. Adjust instruction, web search and file type.
- Generate and store an Idempotency-Key by operation before upload. Reuse it in status queries and repeats.
| Method | Endpoint | Purpose |
|---|---|---|
| POST | https://app.jusneural.com/api/api-jusneural/consultar | Generate a response with optional text and files. |
| GET | https://app.jusneural.com/api/api-jusneural/solicitacoes | Consult the status and result of a previous operation without new generation. |
The generation call is synchronous. The service limits the processing to 100 seconds since the request entry and saves time to complete the logs, with 110 seconds response limit. Set the client's timeout to 120 seconds. The answer is delivered whole, without streaming. The GET query follows the operation; it does not create a queue or resumes a interrupted generation.
Examples of integration
Choose a language and the type of operation. Examples use environment variables and show a full call. Generate, copy and download code does not execute calls or consume credits.
Bash with curl. For example base64, also install jq and base64.
Configure JUSNEURAL_API_KEY e JUSNEURAL_OPERATION_ID in the environment of your server. Generate and store an identifier before sending; reuse it in repetitions and status queries.
74/2,000 characters. Preferences subordinated to Jusneural rules.
Set up also JUSNEURAL_FILE with the local path to the file on the server.
# Defina as variáveis no ambiente antes de executar.
: "${JUSNEURAL_API_KEY:?Defina sua chave da API}"
: "${JUSNEURAL_OPERATION_ID:?Defina um ID único e reutilize-o nas repetições}"
payload='{
"model": "jusneural-2.0-pro",
"messages": [
{
"role": "user",
"content": "Explique os requisitos da tutela de urgência no processo civil brasileiro."
}
],
"instruction": "Responda de forma objetiva, com fundamentação jurídica e linguagem formal.",
"web": false,
"max_output_tokens": 8192,
"max_cost_cents": 1000
}'
printf '%s' "$payload" | curl --request POST 'https://app.jusneural.com/api/api-jusneural/consultar' \
--connect-timeout 10 --max-time 120 --fail-with-body \
--header "Authorization: Bearer $JUSNEURAL_API_KEY" \
--header "Idempotency-Key: $JUSNEURAL_OPERATION_ID" \
--header 'Content-Type: application/json' \
--data-binary @-Run calls on the server. The secret key should stay in an environment variable or secret manager. In network failure, see the operation before repeating POST.
Authentication and preparation
| Header | Value |
|---|---|
| Authorization | Bearer <SUA_CHAVE_DA_API> |
| Idempotency-Key | Operation identifier: 16 to 128 letters, numbers, hyphens or underlined. |
| Content-Type | application/json for text/base64; multipart/form-data with automatic bundle for files. GET does not receive body. |
| Variable used in the examples | How to fill |
|---|---|
| JUSNEURAL_API_KEY | Secret key issued by the panel. Use a secret manager or environment variable. |
| JUSNEURAL_OPERATION_ID | UUID or identifier persisted by its application. Another operation must use another value. |
| JUSNEURAL_FILE | Local path of the file on the server that executes the example. Required only for examples with attachments. |
Run the examples on your application's server. Do not include the key in public pages, distributed applications or repositories. Use HTTPS in integration. Examples read the environment key and do not include personal credentials in the generated code.
The Copy code button only copies the selected example. The sample generator does not execute calls or consume credits. Set up JUSNEURAL_FILE for attachments and choose the corresponding MIME. Use Save in PDF to download the full guide with the selected example.
Consultation body
| Field | Rule |
|---|---|
| model | jusneural-2.0-pro. Single model accepted; it is the default when omitted. |
| messages | Required: 1 to 40 messages. Each must have a role (user or assistant) and non-empty textual content. The last message should be user. |
| messages[].content | Up to 100,000 characters per message and 180,000 characters added in the history. |
| messages[].attachments | Optional and exclusive user messages. In JSON: mime_type, data_base64 and optional filename. In multipart: optional upload and filename. |
| instruction | Optional: up to 2,000 characters. Preference style, scope or format subordinated to the rules of the service; does not change identity or main instruction. |
| web | Boolean; false pattern. true enables web search, in addition to the legal queries of the service. |
| max_output_tokens | Entire from 256 to 32,768; standard 8.192. Includes reasoning. Authorized budget can reduce generation. |
| max_cost_cents | Full of 1 to 30,000; standard 1,000 (R$ 10.00). Maximum amount authorized and reserved for the operation, in centimetres. |
Extra fields, system/developer roles, internal URLs or settings are not accepted. Invalid values return 400. To continue a conversation, send the relevant history and attachments that are still needed.
PDF, images and audios
Multipart is recommended for files. Send a single payload text field containing the call JSON and a binary part per file. In JSON, use attachments: [{"upload":"file_1"}]. The name file_1 needs to match the binary part. Each file should be referenced exactly once; do not repeat parts or mix base64 attachments in the payload multipart.
Let the HTTP library set the Content-Type and the form's boundary. The MIME should be informed in the binary part. The optional filename is in JSON, accepts up to 180 characters without paths and serves only as attachment identification.
In the application/json transport, send mime_type and data_base64: pure base64, no date prefix: and no line breaks. The service interprets the file; the base64 sequence is not charged as literal text.
| Format | MIME Accepted |
|---|---|
| application/pdf | |
| JPEG | image/jpeg |
| PNG | image/png |
| WebP | image/webp |
| MP3 | audio/mpeg |
| M4A / MP4 audio | audio/mp4 |
| WAV | audio/wav |
| Audio OGG | audio/ogg |
| FLAC | audio/flac |
| Audio WebM | audio/webm |
- Up to 4 files in the entire history, being at most an audio.
- Up to 5 MiB per file and 10 MiB in total, before base64.
- Request body: up to 16 MiB, uncompressed. Multipart payload field: up to 2 MiB.
- Body shipping time: 30 seconds, included in the full call deadline. A lengthy shipment reduces the time available for generation.
- Files need to be intact. PDFs must be passwordless. The content also needs to fit in the context and in the authorized budget.
The API service does not store attachments on disk, bank or bucket. They are processed during the call. The response may contain snippets of the analyzed material and is available for 24 hours for consultation and repetition.
Answer, tokens and billing
The text is in choices[0].message.content. usage shows the confirmed consumption of all steps. billing brings values in reals as decimal strings of eight houses; preserves accuracy by storing them.
{
"model": "jusneural-2.0-pro",
"model_name": "Jusneural 2.0 Pro",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Resposta jurídica produzida pelo Jusneural."
},
"finish_reason": "stop"
}
],
"web": false,
"usage": {
"input_tokens": 1000,
"output_tokens": 200,
"total_tokens": 1200,
"output_tokens_details": {
"reasoning_tokens": 40
},
"input_tokens_details": {
"tool_tokens": 0
}
},
"billing": {
"currency": "BRL",
"cost_brl": "0.05543800",
"measured_cost_brl": "0.05543800",
"discount_brl": "0.00000000",
"balance_brl": "299.94456200"
},
"request_id": "11111111-2222-4333-8444-555555555555"
}| Field | Meaning |
|---|---|
| use.input_tokens | Full entry, including service instructions, history, attachments and tool entries. |
| use.output_tokens | Total output, including reasoning, even when it is not displayed. |
| use.*_tokens_details | Detailing already included in the totals. |
| billing.cost_brl | Value effectively debited in this operation. |
| billing.measured_cost_brl | Cost corresponding to confirmed consumption before possible discount. |
| billing.discount_brl | Excess absorbed by the service to respect max_cost_cents. |
| billing.balance_brl | Balance after original debit. In a repeat, does not represent a new reading of the current balance. |
| _Other Organiser | stop: response completed; length: exit limit reached. |
| request_id / X-Request-Id | Support identifiers for tracking. Keep them with the Idempotency-Key. |
Input: R$ 31.38 per million tokens. Output: R$ 120.29 per million. All steps and new attempts with confirmed consumption enter the sum, including when the operation ends with error. No estimated charge. Check usage and billing also in the error responses, when present. The debit never exceeds max_cost_cents.
Impotence, status and new attempts
Save Idempotency-Key before sending POST. If there is a connection failure, please refer to GET /api/api-jusneural/solicitacoes using the same Bearer and the same operation key, without body or files. Only the API key that originated the call can consult the result.
| Response of the GET query | What to do |
|---|---|
| 202; status: processing | Wait Retry-After (3 seconds) and consult again. The generation or completion of the records is still ongoing. |
| 200; status: completed or failed | Read response_status, which contains HTTP of the definitive result, and result, which contains response, consumption and values. |
| 404 | The operation has not yet been registered for this key. If the original POST has finished or failed, repeat with the same ID and the same data. |
| 410 | The 24-hour retention period has expired. The original operation will not be run or billed again. |
If POST returns 504 without usage and billing, the completion of the records may be pending. Please refer to GET with the same Idempotency-Key until you get the definitive result; do not interpret the absence of these fields as zero consumption. A response generated within the deadline may appear as complete in this query if only the final record has taken time. Do not create another ID to recover the answer.
GET does not generate tokens or charge. A final error result is also idempotent: repeat POST with the same ID recovers this result. Use another ID only for a new generation, subject to the collection of confirmed consumption. Change parameters or attachments using the same ID returns 409.
Limits on account, shared between all keys: 60 POSTs per minute, 120 status queries per minute, 3 generations and 3 simultaneous receipts. In 429, respect Retry-After and increase the interval of attempts with a small random variation. Avoid unlimited automatic repetition.
Errors and how to resolve
{
"error": {
"code": "service_unavailable",
"message": "Ocorreu um erro interno. Tente novamente com a mesma Idempotency-Key."
},
"request_id": "11111111-2222-4333-8444-555555555555"
}| HTTP | Situation / action |
|---|---|
| 400 | Parameters, JSON, multipart or invalid attachments. Check the body and limits. |
| 401 / 403 | Invalid key, revoked or unavailable access. Check out Bearer and account status. |
| 402 | Available balance or insufficient budget. Reload or adjust max_cost_cents. |
| 404 | Operation not found for the key used in the query. |
| 408 | Shipping exceeded the deadline. Check out connection and file size. |
| 409 | Operation in progress, closed or Idempotency-Key reused with different data. Check error.code. |
| 410 | Response out of 24-hour retention. |
| 413 / 415 | Size, type of request or compression not accepted. |
| 422 | Unmet content. |
| 429 | Call limit or receiving capacity reached. Respect Retry-After. |
| 500 / 502 / 503 / 504 | Internal failure or timeout. Please refer to the operation before attempting a new generation. |
Treat HTTP status and error.code in the integration code. The message is intended for human reading. Internal failures use generic texts. For support, inform the operation identifiers; do not send your secret key. Client or network failures may not bring JSON body: in such cases, refer to the status using the persisted ID.
Credits and payments
The API wallet is independent of subscriptions, plans and tokens from the other services. Minimum charging of R$ 300.00, by Pix or credit card, by the API panel. The panel shows balance, recent consumption and payment history.
Do you need help with the integration?
Talk to the Jusneural and inform the request_id, the header X-Request-Id Preserve your secret key.