CODING AGENT API QUICKSTART

A small quickstart for a serious integration.

Use the OpenAI-compatible surface your client already understands, then verify the exact model and feature support in your account before production traffic.

Built around a stable OpenAI-compatible request shape.

REQUEST LEDGERillustrative
route /v1$0.42
in prompt context18.4k
out model output2.1k
↺ cached context6.8k
latency windowyour data · your keys

01 / FIRST REQUEST

Use a familiar request shape

The example uses a placeholder model ID and an environment variable for the key. Confirm both values in the console before you run it.

shell
curl https://api.codimixa.com/v1/chat/completions \
+  -H "Authorization: Bearer $CODIMIXA_API_KEY" \
+  -H "Content-Type: application/json" \
+  -d '{"model":"YOUR_MODEL_ID","messages":[{"role":"user","content":"Review this function for a null handling bug."}]}'

02 / BOUNDARY

Keep secrets and agent state in the right place

The website explains the public shape. Your client should hold the key, conversation state, repository context, and tool permissions. The gateway should receive only what the request requires.

Base URL

https://api.codimixa.com/v1 is the public API base used by the current console configuration.

Authentication

Send a bearer key from an environment variable. Never commit it to a repository or place it in browser code.

Model ID

Use the identifier shown for your account. A placeholder is safer than an unverified public model promise.

Response handling

Handle non-2xx responses, timeouts, and rate limits in the client before you add retries.

03 / BEFORE PRODUCTION

Make one small test set

Run a repeatable set of repository tasks, capture the output and token counts, and keep the model choice in configuration. That gives your team a baseline it can revisit after a route change.

  1. 01

    Test a read

    Ask the tool to explain a known function.

  2. 02

    Test a patch

    Give it a narrow bug with a clear expected outcome.

  3. 03

    Test a loop

    Measure a task that uses tools more than once.

NEED ACCESS?

Finish setup in the console.

The website does not create keys. Use the authenticated console for that boundary.

Open console ↗

REQUEST ANATOMY

Know what each field is doing

The request is small, but each field has a job. Make the model ID and key configurable before you add retries or parallel work.

Fields to verify before the first request
FieldPurposeFailure to handle
AuthorizationIdentifies the account keyLeaking the key or receiving 401
modelSelects an account-visible routeUnknown or unavailable model
messagesCarries instructions and contextWrong role or oversized context
Content-TypeTells the gateway how to parse the body400 response or malformed payload

ERRORS ARE PART OF THE API

Build the failure path before the happy path

A coding tool should be able to stop cleanly when the gateway rejects a request. Log a request identifier when the response provides one, but do not log the bearer key or full sensitive context.

401Authentication

Check the key source, environment, and revocation state.

400Request shape

Validate model ID, JSON, roles, and required fields.

429Rate limit

Back off with a bounded retry policy and visible stop condition.

5xxUpstream failure

Do not start an unbounded retry loop; preserve the task state.

PRODUCTION CHECK

A quick readiness review

Run one read-only task, one narrow patch, and one tool loop. Verify that the client can stop, retry once with a bound, and show a useful error to the operator.

Then move the key into the deployment secret store, keep the model ID in configuration, and record the exact base URL and route that were tested.