GUIDE / CONNECT

AI API integration and troubleshooting.

Verify the URL, authentication and model ID before adding streaming or tools. Use the URL and error tables when a request fails. Replace example placeholders with your own Key and available model.

1. Configure the URL and authentication

Compatible clients typically use https://ak47token.com/v1 as the Base URL. Raw HTTP requests pass the API Key in Authorization: Bearer. Create and revoke keys in the console; do not put them in public webpages or repositories.

How should I set the Base URL and /v1 prefix?

A Base URL is the starting point used by a client to build an endpoint, not necessarily the final request URL. Check whether your client adds /v1 automatically and make sure the final path contains it once. Raw curl uses the complete endpoint URL.

Check the Base URL against the final request URL
Request methodWhat to enterWhat to check
Raw HTTP / curlhttps://ak47token.com/v1/chat/completionsThis is the complete chat endpoint. Do not append another endpoint path.
Client expects an API prefixhttps://ak47token.com/v1A chat request should reach /v1/chat/completions. Check how the client builds the path.
Client adds /v1 automaticallyhttps://ak47token.comVerify that it adds the required endpoint and does not produce /v1/v1/....
  • Chat Completions, Responses and Messages are different endpoints. The model must support the required protocol even when the URL is correct.
  • For a 404, check the actual request path first, then whether the error body says that the model is missing.

2. Choose an available model ID

Find a model supporting your target endpoint in the catalog. Copy its ID, not its display name. Check explicit support for chat, images, Responses or tools.

3. Send a normal chat request

Replace the two placeholders below with your own environment variables and run the request. The example limits output to 128 tokens for an initial integration check.

export AK47_API_KEY='YOUR_API_KEY'
export AK47_MODEL='AVAILABLE_MODEL_ID'

curl https://ak47token.com/v1/chat/completions \
  -H "Authorization: Bearer $AK47_API_KEY" \
  -H 'Content-Type: application/json' \
  -d "{\"model\":\"$AK47_MODEL\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello, please reply with a greeting.\"}],\"max_tokens\":128}"

4. Connect your client

After a normal request succeeds, configure the URL, Key and model ID in an app or developer tool supporting custom providers. Tools may use different endpoints. Responses, Messages and Chat Completions are not interchangeable just by renaming them.

  • Duplicated /v1: check whether the client adds the prefix automatically.
  • Authentication failure: check that the Key is complete and enabled, and that Bearer authentication is used.
  • Unavailable model: check the ID, endpoint and capabilities instead of trying random model names.
  • Balance or request failure: check your balance and logs, and keep the request ID for troubleshooting.

How do I troubleshoot 401, 404, balance errors or timeouts?

Check the final URL first, then authentication, model and parameters, followed by available credit and usage records. AK47Token JSON errors use error.message. Clients may reformat the notice, so retain the HTTP status and the X-Request-ID response header.

Checks and next steps for failed API requests
Status or symptomCheck firstNext step
401 / authentication failureIs the Key complete and enabled, and which authentication header does the client use?The chat example uses Authorization: Bearer. Check or revoke the Key in the console; do not send it to support.
404 / missing request pathDoes the final URL duplicate /v1 or point to the wrong endpoint?Correct the path using the URL table, then send a small request.
404 / model not foundDoes model contain a current AK47Token model ID rather than a display name or another platform's name?Check the ID on the public models and prices page, then check its supported endpoint.
402 / insufficient available creditAvailable account credit and the credit required for this request.Check your balance and usage records, including parameters such as the output limit. Avoid repeated requests until resolved.
400 / invalid request parametersJSON, required fields and the specific error.message.Start with this page's minimal request and add one parameter at a time.
501 / unsupported capabilityDoes the selected model and current integration support the requested protocol or feature?Use a model explicitly supporting the capability. Changing only its display name will not resolve this.
502 / 503 / 504, or a client timeoutThe error body and whether usage records already contain a result for this request.Keep the time, model ID and request ID. Contact support for persistent errors and establish the request's status before retrying.
  • A client timeout does not prove that the server failed to finish or that the request was not charged. Check the usage record.
  • For support, provide the time, model ID, final request path, HTTP status, redacted error and X-Request-ID. Remove API Keys, Authorization, Cookie and private request content.

FAQ

Questions & answers

Does a successful normal request prove tool support?

No. Choose a model explicitly supporting tools and the corresponding protocol, then verify it in your actual client.

How do I test streaming?

Check streaming support, then add stream: true. The client must read incremental output according to the protocol rather than parse the whole stream as one JSON object.

Ready to get started?