---
agent_auth:
  skill: https://api.fikraapi.co.ke/.well-known/agent-skills/fikra-inference/SKILL.md
  register_uri: https://api.fikraapi.co.ke/v1/agents/register
  identity_types_supported:
    - anonymous
  anonymous:
    credential_types_supported:
      - client_secret
  claim_uri: https://fikraapi.co.ke/account
  revocation_uri: https://fikraapi.co.ke/account
---
# auth.md

# auth.md

Base URL: `https://api.fikraapi.co.ke/v1`

## 1. Pay per call with x402 (no account needed)

Call `POST https://api.fikraapi.co.ke/v1/agent/chat/completions` with an OpenAI-style body. The server replies
`402` with a `PAYMENT-REQUIRED` header (base64 JSON). Sign the payment with an
x402 client and retry with the `PAYMENT-SIGNATURE` header. The price is quoted
for `input + max_tokens` (default 1024, max 4096); no streaming.

Status: Enabled on `eip155:8453` (USDC), paid to `0x11a571bbd2dc998f373e64b4896865c1804964a0`.

## 2. Register an agent identity

`POST https://api.fikraapi.co.ke/v1/agents/register` with JSON
`{"name": "...", "description": "...", "capabilities": []}`.
The response contains `client_id` and `client_secret` (shown once).

Exchange them for a token:

    POST https://api.fikraapi.co.ke/oauth/token
    grant_type=client_credentials&client_id=...&client_secret=...

Use `Authorization: Bearer <access_token>` (1 hour). Scopes: inference:chat.
A token identifies the agent; calls are still paid per request (section 1).

## 3. Prepaid API key (humans)

Create an account at https://fikraapi.co.ke/account/signup, top up, and send
`Authorization: Bearer fk_...`. Keys are secrets: never put them in prompts,
logs or client-side code.

## Discovery
- OAuth protected resource: https://fikraapi.co.ke/.well-known/oauth-protected-resource
- OAuth authorization server: https://fikraapi.co.ke/.well-known/oauth-authorization-server
- A2A agent card: https://api.fikraapi.co.ke/.well-known/agent-card.json
- MCP server card: https://api.fikraapi.co.ke/.well-known/mcp/server-card.json
- API catalog: https://api.fikraapi.co.ke/.well-known/api-catalog
- Agent skills: https://api.fikraapi.co.ke/.well-known/agent-skills/index.json
- OpenAPI: https://api.fikraapi.co.ke/openapi.json
